Friday, July 18, 2014

How to customize the resolution of CrunchBang in VirtualBox of Windows 7

Before you reading... here is a better solution to solve the problem of screen resolution:
How to install the Guest Additions for CrunchBang in VirtualBox of Windows 7

Host system: Windows 7 x64
Guest system: CrunchBang 11 ``Waldorf'' x64

I've just installed CrunchBang in VirtualBox two days ago, but the resolution was limited so it cannot fit my monitor properly. After some trials (including some struggles when installing the so-called Guest Additions), I successfully changed the resolution to my need.

I mainly followed the instruction of the link: How to adjust the screen resolution in Debian?

But there's some more work to do to make the change permanently. We need to add the following lines (from my own setting) in ``~/.config/openbox/autostart'':

xrandr --newmode "1920x1002"  159.50  1920 2040 2240 2560  1002 1005 1015 1040 -hsync +vsync
xrandr --addmode VBOX0 "1920x1002"
xrandr --output VBOX0 --mode "1920x1002"

How to install the Guest Additions for CrunchBang in VirtualBox of Windows 7

After my installation of CrunchBang in VirtualBox, some functions such as ``Auto-resize Guest Display'' and ``Shared Clipboard'' were not available.

The key is to install the ``Guest Additions''.

I tried some instructions found on Web and the steps are listed as follows:

To install the following packages

This was simple, just install them:
apt-get install dkms build-essential linux-headers-generic

To  mount the Guest Additions image

Actually this confused me and I'm not sure about every details. Here I just write down what I've done for your reference.

The first thing I did was to insert the VBoxGuestAdditions.iso image via the GUI (I've selected the iso file before, so it appeared in the list automatically):

Then click the ``Insert Guest Additions CD image...'' or use the following command to mount the image:
mount /dev/sr0 /media/cdrom
Now we can find the ``VBoxLinuxAdditions.run'' script and run it:



And the Guest Additions should be installed. :-)

---
Refs:
More details could be found here: HOWTO: Install Linux Guest Additions + Xorg config
and here: http://superuser.com/a/261862