Pages

Tuesday, March 31, 2009

How to change ubuntu resolution in Virtual Box

Today, I'm installing Ubuntu 8.04 in Virtual Box, with Vista as the host OS. I'm planning to use it as Qtopia development environment. After the installation is completed, I found that the maximum resolution I could set was only 800x600. After some googling, found the solution as follows:

  1. install linux guest additions in virtual box
    1. Select from menu: Devices, Install Guest Additions... Ubuntu will detect a new CD inserted and mount it automatically.
    2. go to the terminal, run the VBoxLinuxAdditions.run as root
      $ sudo /media/cdrom/VBoxLinuxAdditions-x86.run

  2. edit /etc/X11/xorg.conf using any text editor you're familiar with.
    1. Find section "Device" as follows:
      Section "Device"
              Identifier      "Configured Video Device"
              ...
      EndSection
      Insert additional setting so that the section "Device" will look as follows:
      Section "Device"
              Identifier "Configured Video Device"
              ...
              Driver "vboxvideo"
      EndSection
    2. Find section "Screen" as follows:
      Section "Screen"
              Identifier "Default Screen"
              Device "VirtualBox graphics card"
              Monitor "Generic Monitor" 
              ...
      EndSection
      Modify value of Device and Monitor, and insert some additional setting before EndSection so that the section will look similar with the following (I set resolution 1024x768 here):
      Section "Screen"
              Identifier "Default Screen"
              Device "VirtualBox graphics card"
              Monitor "Generic Monitor"
              DefaultDepth 24
              ....
              SubSection "Display"
                  Depth 24
                  Modes "1024x768"
            EndSubSection
      EndSection

  3. Finish, reboot.

That's all :)

No comments:

Post a Comment