A boring article is usually a story on my blog.
Vagrant is a create commmand line tool of Virtualbox to build a development environment for developers. However, someday, it was abruptly stopped working with one of my VirtualBox machine - terry - development. OMG, it was the development environment for mostly my works.
Situations
How worst was that situations?
- Shared folders set on Vargrantfile not working.
- Cannot connect the private IP was set on the Guest OS.
- DNS not working on Guest OS
I tried many ways I found on the Internet, still not figuring it out, a rescue mission begins.
My plan is to set a shared folder, and then backup everything I need and then put them in the shared folder.
Steps
(1)
Go VirtualBox GUI, click Settings, click Shared Folders.
(2)
Choose a Folder path, in this case, I choose D:\terrylin\c
and name it with c
(3)
So the settings look like the screenshot.
Mount
Fortunately, I can log in to my VirtualBox machine with username vagrant
and password vargrant
.
Change my role to root, type in the follwing command to mount the shared folder.
mount -t vboxsf [-o OPTIONS] sharename mountpoint
Example
Create a new directory for mounting the share folder. In this case, I create a directory called c
in home
.
mkdir /home/c
Use the following command to mount the share folder. In this case, c
is the name I set in Shared Folders settings in VirutalBox GUI.
mount -t vboxsf c /home/c
Backup
Backup my MySQL databases into a sql file, and put it in the shared folder.
mysqldump -root -p --all-databases > /home/c/all.sql
After a few minutes, I can see it in my Windows successfully.
Comments