fstab entry resulting in Emergency Mode at Boot.

Latest response

My Development setup has a RHEL Server 7.3 running inside VirtualBox 5.1.12 over a Windows Host.
I can use shared folder by mounting the directory explicitly from command line every time I log in with the command

mount -t vboxsf share ~/Windows

But Automating this procedure with a fstab entry , results in emergency mode at boot, wherein after logging in as root I remove the entry from fstab and boot proceeds as usual.

The fstab entry is like this ..

share /home/arun/Windows vboxsf rw,uid-1000,gid=1000 0 0

Another variation that I tried was this, with no change in the end result..

/media/sf_share /home/arun/Windows vboxsf rw,uid-1000,gid=1000 0 0

What could be causing this issue? Are there any logs that I can go through to find a fix for this problem ?

Responses

Hi,

it seems the vboxsf module may not be present when the filesystems are mounted.

Check, if you have the module present in the initramfs*.img file.

You have a typo, "uid-1000". It is supposed to be "uid=1000".

For testing, add the "nofail" boot option to avoid dropping into emergency mode in case your boot fails. The problem is probably that the filesystems are mounted before the VirtualBox guest additions have started up. The Guest Additions will include the module that provides the communication path between the host and the guest for connecting to the share.

In the VM settings of VirtualBox, on the "Shared Folders" page, there is a check-mark to have the shared folder auto-mount. By quick testing on RHEL 7.3 and VirtualBox 5.1.18, it works. So the right way to have the shared folder mount automatically would seem to be to tell VirtualBox to handle it. But you cannot set custom mount options for the share - the files will be owned by "root:vboxsf" by default.

https://www.virtualbox.org/manual/ch04.html#sharedfolders

If you use the automatic mount, you must add your user #1000 to the vboxsf group (usermod -a -G vboxsf ).

Or if the mount options are an absolute requirement for you, you should define a custom systemd service that will mount the shared folder with your preferred options. It would have to have at least the following systemd attributes:

[Unit]
After=vboxadd.service

[Install]
WantedBy=multi-user.target

That way, it would start after vboxadd.service, which prepares the communication channel for the shared folders (and apparently also automounts any shared folders configured for automounting).

Close

Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.