How to mount host share directory in Virtualbox Linux system
It's quite easy to install Virtual Box Additions under Windows.
You just mount the .iso file and double click on the drive under
My Computer. It gets installed and once you set up shared
directory in VirtualBox for the choosen virtual a new drive
appears under My Computer. Boom done.
But under Linux it's not that easy. Sometimes you don't even
have a graphical environment installed (yet) and you just want
to access your host filesystem. I couldn't find any official
guide but I figured that out. Here is what made the trick for
me.
To prepare the virtual
- select the virtual you want to modify on the left side.
- right click -> Settings.
- click Shared Folders and then the tiny directory icon
with green plus to add a new shared directory - set following:
- Folder Path: "/"
- Folder Name: ROOT (should get filled in automatically)
- Make Permanent: check
- hit OK button.
- start the virtual.
To prepare the machine
- switch to root user with
sucommand. - run
mkdir /media/root. - run
apt update. - run
apt install linux-headers-$(uname -r) gcc make bzip2.
To install the additions
- in the running Virtual window hit Devices on the top then
Insert Guest Additions CD Image - run
mount /media/cdrom - run
cd /media/cdrom - run
sh VBoxLinuxAdditions.run - run
mount -t vboxsf ROOT /media/root
Your host / path is now mounted under /media/root inside your
virtual.
Leave How to mount host share directory in Virtualbox Linux system to:
Read more #virtualbox posts
Best Posts From n1
We have not curated any of n1-cz's posts yet. But you can encourage our curation team to review posts by visiting them regularly and by referring other readers. Because we give priority to frequently read content.
More Posts From n1
- How to mount host share directory in Virtualbox Linux system
- Project documentation aka own wiki(ish) docs
- How to publish a package to PyPI
- Postgres and date subtracting
- Twitter on blockchain
- Docker + your development and production environments
- Django’s new Extract*() classes
- Docker + SQLite 3
- Vue.js - init a component inside a component programmatically
- Gunicorn — autoreload app