Showing posts with label VirtualBox. Show all posts
Showing posts with label VirtualBox. Show all posts

Sunday, March 6, 2011

VM - Speeding Up A Linux Guest

Recently I was having an issue with a my CentOS guest running slowly in VirtualBox. Evidently this has something to do with the interrupt checking interval of the Linux system being at 1GHz.

To force the guest to use an interrupt check at only 100Hz, the divider=10 kernel option should be set.

Follow these steps:
  • Use the root account (su)
  • Edit the /boot/grub/grub.conf file
  • add "divider=10" to the end of the kernel line
Here is a sample of the modified grub.conf.
# grub.conf generated by anaconda
#
# Note that you do not have to rerun grub after making changes to this file
# NOTICE: You have a /boot partition. This means that
# all kernel and initrd paths are relative to /boot/, eg.
# root (hd0,0)
# kernel /vmlinuz-version ro root=/dev/VolGroup00/LogVol00
# initrd /initrd-version.img
#boot=/dev/sda
default=0
timeout=5
splashimage=(hd0,0)/grub/splash.xpm.gz
hiddenmenu
title CentOS (2.6.18-194.32.1.el5)
root (hd0,0)
kernel /vmlinuz-2.6.18-194.32.1.el5 ro root=/dev/VolGroup00/LogVol00 rhgb quiet divider=10
initrd /initrd-2.6.18-194.32.1.el5.img
title CentOS (2.6.18-194.el5)
root (hd0,0)
kernel /vmlinuz-2.6.18-194.el5 ro root=/dev/VolGroup00/LogVol00 rhgb quiet divider=10
initrd /initrd-2.6.18-194.el5.img

You can use cat /proc/cmdline in order to check if it took.
~ $ cat /proc/cmdline
ro root=/dev/VolGroup00/LogVol00 rhgb quiet divider=10

Saturday, September 12, 2009

VirtualBox Shared Folders - Linux Guest

I keep forgetting how to add a shared folders in my Kubuntu guest machine, so I'm posting it here to help remind me.

Select the folder to share on the host.
VirtualBox -> Settings -> Shared Folders -> Add New...

Create a place for the folder on the guest.
cd /home/username/Desktop/
mkdir ShareName
note: username is your user name, ShareName is some meaningful folder name

It is very important to select a folder that has nothing in it. If you do select an existing folder all the contents will be copied into the host folder. This is a big problem if you point the folder to /home/user.

And one final step. If you want to add the folder perminantly and mount it each time on startup, add the following line to the end of the /etc/fstab file.
ShareName /home/username/Desktop/ShareName vboxsf default 0 0
And that is it. Now anything you put in that particular folder you will see in both the guest and the host OS.