Access Shared Folder on VirtualBox from Guest Linux VM

With graphical desktop, it is easy to move files between guest VM and host. But TurnKey is in text mode, I need a shared folder for file exchange.

Fortunately, it is easy to add a shared folder in VirtualBox. It may be auto-mount in guest VM.

VirtualBox Configuration

  1. Right click on your VM in VirtualBox for [Settings﹍] or select from [Machine] menu.
  2. In [Shared Folders] Tab, add the shared folder on host and tick [Auto-mount]

You may also use any folder on an external hard drive to your host computer as a shared folder. It is useful when you don’t want the shared folder to stay with the same physical hard drive with the guest VM.

Setup Shared Folder in Guest Linux VM

You need to install GNU C compiler and the kernel development packages and  VirtualBox Guest Additions to use the shared folder in guest Linux VM.

To install compiler and development package tools in TurnKey,: switch to root and type:

apt-get update
apt-get install dkms build-essential linux-headers-$(uname -r)

For other Linux, you may identify the Linux distribution of your guest VM by below command. Then follow the instruction specify to your distribution in Guest Additions for Linux.

cat /etc/issue

Now, choose [Install Guest Additions﹍] from [Devices] menu and mount by:

mount /dev/cdrom /mnt

Install VirtualBox Guest Additions and stop spawning an xterm AFAICS support:

/mnt/ --nox11

Now, you may see your shared folder under /media directory with prefix sf_  before your folder name.


  1. TurnKey
  2. Oracle VM VirtualBox
  3. TurnKey: How to install VirtualBox Guest Addons & mount shared folders
  4. VirtualBox: Guest Additions
  5. How tell what Linux distribution and version is running?
  6. VirtualBox: 4.2.2. Guest Additions for Linux
  7. VirtualBox: Guest additions without X
  8. VirtualBox: Shared folders and Apache
  9. VirtualBox: HOWTO: Use Shared Folders

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s