Enable shared folders on the virtual machines
To be able to use shared folders between the host ( your workstation ) and the virtual machine.
- Start the Ubuntu virtual machine in Virtual Box,
- Select the virtual machine window on your workstation,
- In the Devices menu of Virtual Box select Insert Guest Additions CD image…
- Click the Run button,
- Enter your admin password and click Authenticate,
- Select the terminal window and press Enter,
- Restart the virtual machine for the change to take effect,
- In Ubuntu
- Open a terminal window,
- In the upper left corner of the desktop click the Search icon,
- Type terminal into the search box,
- Select the Terminal icon.
- In the Terminal window create a directory for the mount point
mkdir ~/host-share sudo chmod 777 ~/host-share
- Mount the Shared Windows location. Get the Machine Folder name from the virtual machine’s Shared Folders tab in VirtualBox
(If you shared the root of a Windows C: drive, the name is “C_DRIVE”.)sudo mount -t vboxsf -o uid=$UID,gid=$(id -g) MY_MACHINE_FOLDER_NAME ~/host-share
Source: https://help.ubuntu.com/community/VirtualBox/SharedFolders
Make the mounting permanent
- Create the folder /opt/scripts
- Create a new file in the new folder mount_host_share
#!/bin/sh # Mount the Host Share to see the host computer's file system echo MY_PASSWORD | sudo -S mount -t vboxsf -o uid=1000,gid=1000 MY_MACHINE_FOLDER_NAME ~/host-share
- Make the file executable
chmod +x /opt/scripts/mount_host_share
- On the Ubuntu desktop click the Search icon and type startup, and click the Startup Applications icon
- On the Startup Applications Preferences window click Add,
- Enter the Name and this Command, and click Save
/opt/scripts/mount_host_share
The shared drive appears in the File manager.
Relax the password requirement
The virtual machine is already protected by the operating system of the host, your workstation, so it is not necessary to enter the password every time you want to switch to the guest machine. To remove the password requirement
- Click the System Settings icon in the sidebar,
- Uncheck the Waking from suspend and Returning from blank screen checkboxes.