Virtualbox Tips for Ubuntu Guest in Windows Host

Sat, Jul 2, 2016 Last Modified: Jul 7, 2016
Category: tutorial Tags: [linux] [ubuntu]

For Ubuntu tips, see http://jessezhuang.github.io/ article/ubuntu/.

How to Get Shared Folder Write Access

When used as a virtual machine guest (Ubuntu 14.04LTS in Windows 10 host with Oracle VirtualBox), to get access to shared folder, run the following command in shell, replace username with your ubuntu username.

# replace username with your actual ubuntu username
$ sudo usermod -a -G vboxsf username

After that, reboot the VM and you should have write access to the shared folder.

How to Create Virtualenv in Shared Folder

Creating symbolic links in a VirtualBox shared folder is disabled, which will forbid you to create a virtualenv in a shared folder from the host machine. Simple test in terminal: $ ln -s test, Either you’ll get a failed to create symbolic link './testfile': Read-only file system or Protocol error. Shutdown VM and close Virtualbox Manager in Windows host. Open an admin command prompt,

C:\WINDOWS\system32>VBoxManage setextradata VM_name 
  VBoxInternal2/SharedFoldersEnableSymlinksCreate/shared_folder 1

If you have not added virtualbox commands to your path, either do so or run VBoxManage from the folder where it is located. Replace VM_name with the name of the virtual machine,

vmname in virtualbox manager

and the name of shared_folder with the name of the shared folder in the settings of your virtual machine,

shared folder name screenshot.

You can check the settings with the command below and should find one key about your shared folder indicating that it was enabled as in the second line below.

C:\WINDOWS\system32>vboxmanage getextradata ubuntu14-ppbdmmdd enumerate
Key: VBoxInternal2/SharedFoldersEnableSymlinksCreate/shared_folder, Value: 1

Note that you still need to run the VirtualBox Manager as an administrator from Windows in order for the creation of virtualenv (symlinks) to work properly.

comments powered by Disqus