VirtualBox shared folders symlink support - VBoxManage doesn't see my VMs

Status
Not open for further replies.

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,504
I know VirtualBox isn't exactly a plugin, but it's kind of like one--hope this forum is a decent place to post.

I'm trying to set up Zoneminder on my FreeNAS 9.3 system. Since the FreeBSD port isn't of the latest version, and the source doesn't compile directly in a jail, I decided to build a Ubuntu VM inside my VirtualBox jail, and install Zoneminder there. I built the VM, installed Ubuntu Server 14.04 LTS, installed all the updates and appropriate packages for zoneminder, and life was good. Except...

I didn't want my recordings chewing up space on the VirtualBox virtual disk file, and I wanted them to be readily accessible outside of the VM, so I set up a dataset on the FreeNAS server, mounted it as storage to the VirtualBox jail, installed the VBox guest additions inside the VM, and mounted two directories from that dataset as shared folders inside the VM. This is working--I can create a file from the FreeNAS CLI, and see it inside the mountpoint in the VM, and vice versa. All peachy keen. Except...

Zoneminder apparently relies on being able to create symlinks within the images and events directories. VirtualBox apparently does not, by default, support symlinks in shared folders. Also apparently (see https://github.com/mitchellh/vagrant/issues/713 and http://stackoverflow.com/questions/...albox-4-3-to-use-symlinks-on-guest-for-meteor), as of VBox 4.1.8, you can set an option to enable symlinks if the host OS supports them (FreeBSD of course does) and the guest OS supports them (which Linux does).

All I need to do, according to those sources, is issue the command
Code:
VBoxManage setextradata VM_NAME VBoxInternal2/SharedFoldersEnableSymlinksCreate/SHARE_NAME 1

for each shared directory that I want to do this for. And here's the problem--VBoxManage doesn't seem to see that, or any other, VM:
Code:
root@virtualbox2:/ # VBoxManage setextradata zoneminder VBoxInternal2/SharedFoldersEnableSymlinksCreate/images 1
VBoxManage: error: Could not find a registered machine named 'zoneminder'
VBoxManage: error: Details: code VBOX_E_OBJECT_NOT_FOUND (0x80bb0001), component VirtualBox, interface IVirtualBox, callee nsISupports
VBoxManage: error: Context: "FindMachine(Bstr(a->argv[0]).raw(), machine.asOutParam())" at line 804 of file VBoxManageMisc.cpp
root@virtualbox2:/ # VBoxManage list vms
root@virtualbox2:/ # 


I have only one VirtualBox jail, and I have other VMs running in it at the moment. I feel like I'm probably missing something very simple, but I'm not sure what it is. Any ideas?

Edit: After noticing this ticket against VirtualBox, I did 'su vbox' inside the jail. I was then able to list the VMs and make the change. After restarting the jail and launching the VM, zoneminder appears to be happily recording away, and not complaining about an inability to create symlinks.
 
Last edited:
Joined
Mar 6, 2014
Messages
686
Thanks @danb35 ! 'su vbox' finally got some things working for me. I still wonder however, why this doesn't work:
Code:
su -m vbox -c 'VBoxManage setextradata "VirtualMachine" bladiebladiebla'
 

FlyingPersian

Patron
Joined
Jan 27, 2014
Messages
237
Hi
Can you please tell me step by step how you installed ubuntu in vbox? I'm stuck here for a week now. Using the vbox-jail-template won't let me install VBox Guest Additions, creating a standard jail and installing vbox with pkg won't let me start a vm. I'm really stuck here and you seem to just have done this without any issues.
Thanks in advance!
 

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,504
You don't install the guest additions in the jail, you install them in the guest OS. As best I can remember, my process went like this:
  • Create virtualbox jail
  • Add some dataset as storage to the virtualbox jail
  • Download the guest additions ISO and the Ubuntu installer ISO you want to use to the dataset noted above
  • Browse to http://jailip, use the PHPVirtualBox web GUI to create the VM, enable remote display on that VM, mount the Ubuntu ISO to the VM, boot, and use your favorite VNC client to complete the installation. Suggest you configure it as an SSH server in addition to whatever else you install.
  • Once installation is complete, using the PHPVirtualBox web GUI, unmount the Ubuntu ISO and mount the guest additions ISO.
  • Reboot the VM
  • Either SSH or VNC to the ubuntu VM, mount the guest additions ISO ("mount /dev/cdrom /media" should do it), cd /media, and use the Linux installer on that ISO. You'll need to have gcc installed, and I don't remember what all else. IIRC, "apt-get install build-essential" should take care of the dependencies.
 

FlyingPersian

Patron
Joined
Jan 27, 2014
Messages
237
That's what bothers me most, I did more or less exactly that! I also installed "dkms" and "make". I keep getting some header issue so that the guest additions cannot be installed. I'll recreate a debian vm now and try it out again.
 

FlyingPersian

Patron
Joined
Jan 27, 2014
Messages
237
Same as always:

Code:
root@debian:/media# ./VBoxLinuxAdditions.run
Verifying archive integrity... All good.
Uncompressing VirtualBox 4.3.12 Guest Additions for Linux............
VirtualBox Guest Additions installer
Copying additional installer modules ...
Installing additional modules ...
Removing existing VirtualBox non-DKMS kernel modules ...done.
Building the VirtualBox Guest Additions kernel modules
The headers for the current running kernel were not found. If the following
module compilation fails then this could be the reason.

Building the main Guest Additions module ...fail!
(Look at /var/log/vboxadd-install.log to find out what went wrong)
Doing non-kernel setup of the Guest Additions ...done.
Installing the Window System drivers
Could not find the X.Org or XFree86 Window System, skipping.
Code:

It fails to build the main guest additions module -.- I did everything the way you told me to. Installed gcc, make and build-essentials, mounted the guest additions iso (which I've done before as well) and then install the linux version. Any ideas?
 

FlyingPersian

Patron
Joined
Jan 27, 2014
Messages
237
# sudo apt-get install linux-headers

Getting this:

Code:
Package linux-headers is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

E: Package 'linux-headers' has no installation candidate


Tried linux-headers-generic and linux-headers-`uname -a`, but both fail :/

EDIT: Okay I fixed it by trying to install linux-headers-´´uname -a´ again. Now the main module is installed, but not the folder share module. The logfile tells me ]this. The short and I think important part is this:

Code:
  1. usr/src/linux-headers-3.16.0-4-common/scripts/Makefile.build:262: recipe for target '/tmp/vbox.0/regops.o' failed
  2. make[4]: *** [/tmp/vbox.0/regops.o] Error 1
  3. /usr/src/linux-headers-3.16.0-4-common/Makefile:1350: recipe for target '_module_/tmp/vbox.0' failed
  4. make[3]: *** [_module_/tmp/vbox.0] Error 2
  5. Makefile:181: recipe for target 'sub-make' failed
  6. make[2]: *** [sub-make] Error 2
  7. Makefile:8: recipe for target 'all' failed
  8. make[1]: *** [all] Error 2
  9. /tmp/vbox.0/Makefile.include.footer:79: recipe for target 'vboxsf' failed
  10. make: *** [vboxsf] Error 2
  11. Creating user for the Guest Additions.
  12. Creating udev rule for the Guest Additions kernel module.
 
Last edited:

Whattteva

Wizard
Joined
Mar 5, 2013
Messages
1,824
Looks like it failed compiling two object files (regops and vbox). Unfortunately, the log file doesn't really specify why it failed, just that it did fail (at least from the bit that you posted).
 
Status
Not open for further replies.
Top