Changing screen resolution of Ubuntu in virtualbox

ubuntu allows screen resolutions bigger than 800 x 600. To get this to work under virtualbox, some tricks are needed.

# if not already done, install the desktop.
sudo apt-get install ubuntu-desktop

# once done, need to configure screen resolution. By default ubuntu only allows 800 x 600 or 640 x 480.
# get linux source first.
sudo apt-get install linux-headers-$(uname -r)

# restart gdm
/etc/init.d/gdm restart

# After logging into the gui, Navigate through the Devices menu to reach the Install Guest Additions option. Click OK when the cdrom dialog box pops up.
# the prompt should install the necessary drivers for you. If not, you have to manually do it yourself

sudo bash /mnt/cdrom/

# After that, replace /etc/X11/xorg.conf with the following config. Change the resolution to suit your needs
Section "Device"
	Identifier	"Configured Video Device"
	Driver		"vboxvideo"

Section "Monitor"
	Identifier	"Configured Monitor"

Section "Screen"
	Identifier	"Default Screen"
	Monitor		"Configured Monitor"
	Device		"Configured Video Device"
	DefaultDepth	24
	Subsection "Display"
		Depth	24
		Modes	"1860x1020"

Author: bpeh

Bernard Peh is a great passioner of web technologies and one of the co-founder of Website Design and Reviews. He works with experienced web designers and developers everyday, developing and designing commercial websites. He specialises mainly in SEO and PHP programming.