Saturday, December 10, 2011

Configuring VM Display and Mouse

Since I started working at a new company, virtual PC became one of the helpful things for me, and with a newly issued high-performance workstation, I could run multiple virtual machine with ease. By now, I already have 4 virtual machine configured, all in CentOS environment. I used this VM as a test environment before I implement optimization on my production system.

Usually, I run linux in CLI, but one of the application i'm going to install requires Linux GUI. I successfully installed CentOS 5 in graphical mode, but graphics were garbage and I couldn't get my mouse to work on VM.

@ default depth of 24

Here's how I made it to work.

This will enable you to use X11 graphical mode on virtual machine.

      - boot your VM in graphical mode
      - upon seeing the log on screen hit  Ctrl + Alt + F1 to get in the shell

(other method is to do via ssh, just start your VM and let it boot until "Username" logon appears, despite of garbage graphic, you may still see the logon screen of Centos 5. Once it appears, connect to your VM via ssh, provided you configured the IP Address during the installation process)

#vi /etc/X11/xorg.conf

      - look for Section "Screen" and change the default depth from 24 to 16, you can also add Modes "800x600" if you want to customize your screen resolution.

Section "Screen"
              Identifier             "Screen0"
              Device                "Videocard0
              DefaultDepth      16
              SubSection "Display"
                            Viewport         0 0
                            Depth              16
                            Modes             "800x600"
              EndSubSection
EndSection

      - exit from vi saving the changes
      - restart VM

After changing Display Depth to 16

At this point, you can now view your VM in graphical mode but your mouse still won't work.... don't worry, we are not finish yet.

To fix the mouse pointer, edit your grub.conf

#vi /boot/grub/menu.lst

Add the following line on the kernel option

kernel /vmlinuz-2.6.18-194.el5 ro root=/dev/VolGroup00/LogVol00 rhgb quiet i8042.noloop psmouse.proto=imps clock=pit
initrd /initrd-2.6.18-194.el5.img
IMPORTANT NOTE:  "i8042.noloop ......."  should be in the same line with "kernel" or else it won't work.

Here's why:

      i8042.noloop -------------- fixes mouse issue
      psmouse.proto=imps -------- gets the mouse wheel working (though I placed this, my mouse wheel still doesn't work, but it's ok for me as I'm not working most of the time in graphical mode)
      clock=pit ----------------- fixes clock issue


No comments:

Post a Comment