Search This Blog

Thursday, July 3, 2014

VirtualBox - OSGEO Live - and MacOSX

I've been trying to get the shared folders to work on a Mac running Mavericks and VirtualBox hosting OSGEO Live VM.

The issues was getting the latest kernel headers... the answer is here... many thanks to Andrew Kirkpatrick for the solution.

http://www.andrew-kirkpatrick.com/2011/12/virtualbox-guest-additions-with-shared-folders-on-mac-os-x/


---- text copied from Andrew Kirkpatrick's Site as a backup -----

1
2
3
sudo mkdir /dev/dvd
sudo mount /dev/dvd1 /mnt/dvd/
cd /mnt/dvd
Then you should see VBoxLinuxAdditions in that directory, which you need to run as per the manual. If the above doesn’t work it might be because your DVD drive in VirtualBox is called something else, like dvd (instead of dvd1) which probably differs depending on which distro you’re using.
Then you need to run the installer.
?
1
sudo sh ./VBoxLinuxAdditions.run
Once that’s done you can restart.
?
1
sudo reboot now
Everything should be finished now installation/configuration-wise, but you might encounter some problems… (otherwise skip to Mount the host folder)

Kernel header problems

I got some missing kernel header problems when trying to install Guest Additions, which if building the main Guest Additions module fails will be logged.
?
1
cat /var/log/vboxadd-install.log
If you see something like this…
?
1
2
3
Error! Your kernel headers for kernel 2.6.35-28-generic cannot be found at
/lib/modules/2.6.35-28-generic/build or 
/lib/modules/2.6.35-28-generic/source.
?
1
2
You can use the --kernelsourcedir option to tell DKMS where it's located,
or you could install the linux-headers-2.6.35-28-generic package.
So you can do just that!
--------

Note: to find out which headers you need type this...
uname -a

--------
?
1
2
sudo apt-get install linux-headers-2.6.35-28-generic
sudo ./VBoxLinuxAdditions.run
Hopefully this should install now (although the XFree86 bit will fail, assuming you’re using the command-line) and you may need to restart the VM, although I’m not sure.

Mount the host folder

You can create the host folder in the VirtualBox Manager in the Shared Folders tab on the Settings for that VM. If you add it on the command-line it’ll appear under the machine folders anyways. If you want to type it though, here’s what you’d type into the Mac OS X terminal (note this is the only thing that you’d type into the host itself)
?
1
2
VBoxManage sharedfolder add "my-ubuntu-vm" \
--name "websites" --hostpath "/Users/andrew/pizza"
To mount the Shared Folder from within the guest, the instructions from Ubuntu (as my guest is Ubuntu, although I think this is a better way to mount it anyways) were very useful.
?
1
2
3
4
5
sharename="whatever.you.want.to.call.it";
sudo mkdir /mnt/$sharename \
sudo chmod 777 /mnt/$sharename \
sudo mount -t vboxsf -o uid=1000,gid=1000 $sharename /mnt/$sharename \
ln -s /mnt/$sharename $HOME/Desktop/$sharename


No comments: