0

I am beginner on using the VirtualBox, I was wondering where the files will be saved if I created a site in Ubuntu using VirtualBox?

Will VirtualBox give an allocated space for the web development files?

4
  • For documentation see Oracle VM VirtualBox®, User Manual. Apr 12 '17 at 1:32
  • They will be saved in the virtual disk image associated with Ubuntu in VirtualBox. Nothing will be saved locally to your host machine. Apr 12 '17 at 1:36
  • Oh okay, so I will give the virtualbox a virtual disk space (is that right)? and if I, for example uninstall/delete the VirtualBox, it will deleted as well?thank you. Apr 12 '17 at 1:43
  • Yes. Whatever is on a VirtualBox guest OS—such as Ubuntu—will be destroyed if you remove that virtual machine from your hard disk or completely uninstall VirtualBox. Apr 12 '17 at 1:45
0

Files that you create in VirtualBox will be saved in a guest OS snapshot file when you create a snapshot of the guest OS. If you delete the guest OS, you also delete all the saved files in the guest OS's snapshots. The exception to this is if you have created a shared folder with the host OS in the VirtualBox guest OS settings and saved some files in the shared folder, the saved files will not be deleted from the shared folder in the host OS if you delete the guest OS.

The location where the development files are saved is up to you. You could, for example, create a new folder named Development Site on your desktop and save the development files there or you could create a folder named Development Site inside a shared folder that is set to Auto-mount in the VirtualBox guest OS's settings.

enter image description here

How to create a shared folder

Open VirtualBox application -> click guest OS -> click Settings (yellow gear icon) -> in the left pane of the guest OS's Settings window select Shared Folders -> click the Add new shared folder icon (blue folder with a green plus sign in the screenshot) -> in the Add Share window navigate to and select the Folder Path and check the checkbox to the left of Auto-Mount. The name of the shared folder should be one continuous string with no blank spaces in the folder's name.

How to mount the shared folder in an Ubuntu guest OS

  1. Open the terminal.

  2. Run the following commands to list the name of the shared folder.

     sudo -i
     cd /media
     ls
    
  3. In the following command, let's assume the name of the shared folder is Windows_Ubuntu_shared_folder, then run this command to mount the shared folder.

     mount -t '/media/Windows_Ubuntu_shared_folder'
    
  4. Use the cp command to copy files to/from the shared folder. Type man cp to show the manual of the cp command.

1
  • I created a shared folder in the HOST (windows) how can I connect it to Ubuntu (virtualbox) ? thanks. Apr 13 '17 at 3:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.