M
M
Max2017-01-11 18:11:40
linux
Max, 2017-01-11 18:11:40

Why doesn't automatic mounting of shared packages work in Ubuntu?

Hello. Installed VirtualBox on win7. Raised Ubuntu Server v16.04 on a virtual machine and decided to make shared directories between the axes. I did everything according to the manual
After running the command
sudo mount -t vboxsf domains /var/www/domains
I checked - everything works. But I don’t want to mount it manually every time, so, as indicated in the article, I made automatic mounting:
sudo echo domains /var/www/domains vboxsf defaults 0 0 >> /etc/fstab
After rebooting, the message flies:
Welcome to emergency mode! After logging in, type "journalctl -xb" to view system logs, "systemctl reboot" to reboot, "systemctl default" to try again to boot into default mode.
Give root password for maintenance
(or type Control-D to continue):
If you comment out the line in /etc/fstab that is responsible for automatically mounting the shared dir, then everything loads without errors, but you have to mount it manually. How to be?
===== SOLUTION =====
1. Do not add anything to etc/fstab !!!
2. sudo nano /etc/modules (add the line: vboxsf )
3. sudo nano /etc/rc.local
Before exit 0 add the line mount.vboxsf domains /var/www/domains vboxsf

Answer the question

In order to leave comments, you need to log in

4 answer(s)
S
Saboteur, 2017-01-11
@matios

add the mount command to /etc/rc.local before exit
mount -t vboxsf share /media/share

S
Sly_tom_cat ., 2017-01-11
@Sly_tom_cat

At boot time, the mount can (and does) happen before the VirtualBox support extensions are loaded. Therefore it fails to mount.
Systemd rules this issue - this is where you need to configure the mount after loading the VirtualBox extensions.

R
Roman Romanov, 2017-01-11
@Roman_Romanov

had the same problem. NOT decided. I created a shell script and added the mount command to it. Now, at the start of the virtual machine, I execute ./mnt, under the root. Haven't found anything better yet.

P
pfg21, 2017-02-17
@pfg21

went vzhoposhny kostyling ...
it is necessary to add drivers for vboxsf to initramfs, when loading the system does not find the driver for shared folders and naturally gives a mount error.
the solution
to the file /etc/initramfs-tools/modules
is to enter the line
vboxsf at the end
and after starting the update of the initramfs
sudo update-initramfs -cu
then mounting vboxsf will become possible at any stage of loading

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question