Installing VirtualBox Guest Additions in Ubuntu Server

Insert the image by selecting the menu item of Devices / Insert Guest Additions CD Image... (Host+D).

Mount the inserted image.

$ sudo mount -t iso9660 -o ro /dev/cdrom /media/cdrom

Execute file.

$ cd /media/cdrom
$ ls -1F
$ sudo ./

The script may complain about the absence of gcc and make. Install them and run the script again.

$ sudo apt-get -y install gcc make
$ sudo ./

You can unmount the cdrom.

$ sudo umount /media/cdrom

You might want to reboot the guest.

$ sudo /sbin/shutdown -r now

One of benefits that guest additions offers is sharing folders between the host and the guest.

$ ls -l /media
drwxr-xr-x 2 root root    ____ MMM dd HH:mm cdrom/
drwxrwx--- 1 root vboxsf _____ MMM dd HH:mm sf_shared/

You can add yourself to vboxsf group and use them.

$ sudo adduser <yourself> vboxsf

You need to logout and login for making the change effects.

$ logout

Now you can read/(write) in the shared directory.

$ cd /media/sf_shared/
$ echo test > test.txt
$ cat test.txt

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s