Enabling Clipboard Sharing and Shared Folder on VirtualBox (Ubuntu Linux Guest)


This post shows how to enable clipboard sharing and file sharing via shared folder between VirtualBox guest OS and host OS. In this post, I use Windows 10 as the host and Ubuntu Linux as the guest.

 

Assumptions
To enable those functions, “VirtualBox Guest Additions” needs to be installed on the guest OS. Please see here (step 4, 22-24) for the installation.

 

1. Enabling Clipboard Sharing
1-1. Launch”Oracle VM VirtualBox”.

1-2. Select your Ubuntu guest and press ctrl + s to open “Settings” window.

1-3. Select “General” and “Advanced” tab.

1-4. Select “Bidirectional” for both “Shared Clipboard” and “Drag’n’Drop”.
(* For some reason, dragging and dropping files to Linux guest is not working in my environment.)

 

 

2. Enabling Shared Folder (Automatic Mounting)
2-1. On “Settings” window, select “Shared Folders”.

2-2. Click on “Adds New Shared Folder” icon.

2-3. Set the path and name for the folder you want to share.

2-4. Check “Auto-mount” and “Make Permanent” options, then press OK.

2-5. Start the guest OS.

2-6. Add your user to the vboxfs group.

sudo usermod -a -G vboxsf $USER

2-7. Reboot the guest OS.

sudo reboot

2-8. After restart, the shared folder should be mounted to “/media/sf_<shared_folder_name>”. In this example, it’s “/media/sf_share”. So, now you can access the shared folder like:

ls /media/sf_share

 

 

Reference
– How To Install Ubuntu Linux On Windows 10 In 24 Steps
https://www.lifewire.com/install-ubuntu-linux-windows-10-steps-2202108

– Ubuntu Documentation: VirtualBox/SharedFolders
https://help.ubuntu.com/community/VirtualBox/SharedFolders

– Automatic mounting — Oracle VM VirtualBox User Manual
https://www.virtualbox.org/manual/ch04.html#sf_mount_auto