Virtual Machines in Linux

Posted by John
on Sunday, 20 July 2008
Download VirtualBox

Download VirtualBox, binary link will redirect you to Sun's site.

Installing

For me, I needed to install libqt3-mt before I could successfully install the 64bit package,

sudo aptitude install libqt3-mt

Now Install your download with...

sudo dpkg -i virtualbox_1.6.2-31466_Ubuntu_hardy_amd64.deb

Further note, you may need to recompile the VirtualBox kernel module if a previous install failed or you didn't have the necessary dependencies first time; this is done by:

sudo /etc/init.d/vboxdrv setup
Permissions
  • Goto System / Administration / Users and Groups
  • Click 'Unlock'
  • Enter your password and click to 'Authenticate'
  • Click 'Manage Groups'
  • Find the 'vboxusers' group and click properties for it
  • Make sure there's a checkbox next to your name within that group, so you are part of the 'vboxusers' group

You will have to reboot your machine for the change to take effect.

USB Support

By default USB support is disabled, to enable it;

sudo nano /etc/init.d/mountdevsubfs.sh

Inside you'll find a block looking like;

# Magic to make /proc/bus/usb work
#
#mkdir -p /dev/bus/usb/.usbfs
#domount usbfs “” /dev/bus/usb/.usbfs -obusmode=0700,devmode=0600,listmode=0644
#ln -s .usbfs/devices /dev/bus/usb/devices
#mount --rbind /dev/bus/usb /proc/bus/usb

Edit it to look like;

# Magic to make /proc/bus/usb work
#
mkdir -p /dev/bus/usb/.usbfs
domount usbfs “” /dev/bus/usb/.usbfs -obusmode=0700,devmode=0600,listmode=0644
ln -s .usbfs/devices /dev/bus/usb/devices
mount --rbind /dev/bus/usb /proc/bus/usb

(basically uncomment the last four lines)

Save changes and close the file (CTRL+X and Y)

Create a VM

Applications / System Tools / Sun xVM VirtualBox

Scroll down and click 'I Agree' on the licence agreement, then fill in the registration information to use VirtualBox, first time.

The rest is pretty self-explanatory if you've used other VM packages like OSX Parallels or Microsoft Virtual Machine.

  • Click 'New'
  • Enter a name for your VM, choose the target platform you're going to use it for
  • Choose Base Memory
  • Create a new Virtual Disk Image, click 'New'
  • Click 'Fixed Size' (for simplicity), 8GB should be enough for starters, you can choose 'Dynamic' which will grow or shrink the disk image based on usage
  • Click 'OK' then 'Finish' to build the Virtual Disk Image
  • Once the image has been created (may take 5+ minutes) it will show the new disk image in a listbox for selection, make sure it's selected and click 'Next' then 'Finish'

You now have a virtual machine ready for whichever ISO or CD-ROM install you wish to place on it. You can hit Machine / Settings / CD-ROM to select an ISO image to boot from so you can install from a disk image.

Note: Even if you're running on a 64bit machine, the virtual machines will still operate under a 686 (32bit) platform.

All the best,

(originally based on a guide from Ubuntu Geek)

ArchLinux KDE, killing the double-tap

Posted by John
on Sunday, 13 April 2008

With ArchLinux, the one thing they don't tell you until you install it is that you have to build the graphical GUI yourself. Honestly sometimes it's like a rite of passage solving all the problems you encounter along the way, good but hard work.

Anyway, I've thankfully managed to solve the one thing that's been driving me spare over the past week, that being the laptop's touchpad hyperactively tapping and opening apps when I don't want them to.

Once you've got KDE installed as your desktop GUI you may run into this problem, here's a copy of the most important sections of my xorg.conf file to solve the issue.

nano /etc/X11/xorg.conf

Here's the head section where you define your devices...

Section "ServerLayout"
    Identifier     "X.org Configured"
    Screen      0  "Screen0" 0 0
    InputDevice    "Mouse0" "CorePointer"
    InputDevice    "Keyboard0" "CoreKeyboard"
    InputDevice    "Touchpad"  "SendCoreEvents"
EndSection

After which down the line you define your touchpad configuration...

Section "InputDevice"
    Identifier  "Touchpad"
    Driver  "synaptics"
    Option  "Device"   "/dev/input/mouse0"
    Option  "Protocol"   "auto-dev"
    Option  "LeftEdge"   "130"
    Option  "RightEdge"   "840"
    Option  "TopEdge"   "130"
    Option  "BottomEdge"   "640"
    Option  "FingerLow"   "7"
    Option  "FingerHigh"   "8"
    #Option  "MaxTapTime"   "180"
    #Option  "MaxTapMove"   "110"
    #Option  "EmulateMidButtonTime"   "75"
    Option  "TapButton0" "0"
    Option  "TapButton1" "0"
    Option  "TapButton2" "0"
    #Option  "VertScrollDelta"   "20"
    #Option  "HorizScrollDelta"   "20"
    Option  "VertScrollDelta"   "0"
    Option  "HorizScrollDelta"   "0"
    Option  "MinSpeed"   "0.25"
    Option  "MaxSpeed"   "0.50"
    Option  "AccelFactor"   "0.010"
    Option  "EdgeMotionMinSpeed"   "200"
    Option  "EdgeMotionMaxSpeed"   "200"
    Option  "UpDownScrolling"   "1"
    Option  "CircularScrolling"   "1"
    Option  "CircScrollDelta"   "0.1"
    Option  "CircScrollTrigger"   "2"
    Option  "SHMConfig"   "on"
    Option  "Emulate3Buttons"   "on"
EndSection

NOTE: The most important sections really are...

    Option  "TapButton0" "0"
    Option  "TapButton1" "0"
    Option  "TapButton2" "0"
    Option  "VertScrollDelta"   "0"
    Option  "HorizScrollDelta"   "0"

Once edited, save and reboot your X11 terminal by pressing CTRL+ALT+BACKSPACE and the tapping should be gone.

Worked for me but eventually needed a full reboot to really take effect, finally I can get to and build this baby.

NOTE: Also check your KDE Control Center / Peripherals / Mouse -> set to double-click for opening apps.

At the moment I'm trying to get XEN to bootup, once I figure that out I'll post it here; plus a more in-depth info on how the server project went.

Chat later,

Multi-Boot Vista + ArchLinux with GRUB

Posted by John
on Thursday, 20 March 2008

After setting up my new HP laptop with Vista and ArchLinux I thought I'd post how to replicate the same setup to help anyone else wanting to do the same, so here's a guide to do this with the latest Windows Vista and Arch Linux; enjoy!

Install Windows Vista

Vista

First off install Vista. Now when it gets to asking you about how much disk space to use, say half (250gb drive => 128gb approx), this will mean the other half will be unused space (perfect for your linux build).

Install Vista and set it up, when you're happy and it's running ok continue to the next step.

Get ArchLinux

By now you should have two hard-drive partitions, one with Vista (NTFS) and one blank; now we're going to sort that second one out.

First download the relevant ISO disc image,

Download it and burn it to CD, it's only 120mb so shouldn't take too long. Once done insert it into your laptop and re-boot with it so it starts up the installer on bootup.

Install ArchLinux

ArchLinux

When the installer boots up and shows the blue install screen you'll see 6 options, let's go thru each one...

1. Prepare Hard Drive

Don't choose Auto-Prepare, it'll wipe your hardrive and destroy Vista, select Partition Hard Drives which will put you in the disk partition tool.

You should see two entries, one will be...

1. [boot] [primary] [ntfs]
2. ...... [unknown] [unknown]

The first is setup as the boot partition (the one which will boot on startup) and you know it's Vista as the filesystem is marked as NTFS, the other is unknown; our target for the Linux install.

So select the unknown one and create, mark it as a primary partition, select write to write the change and then quit to continue. Note the name of the new partition (e.g. hd0/sda2) and goto step 2.

Note: SDA = SATA, the machine i'm using has SATA drives, if you've got older IDE drives it'll be HDA0.

2. Set Filesystem Mountpoints

With this we'll want to set which partition we want to use as a swap disc, but as we didn't create one, select none.

Next you'll be asked which partition will be used as the root one for this install, select hd0/sda2 (or whichever name you wrote down in step 1). Continue to step 3.

3. Select Packages

Here we select which packages we want to install, ArchLinux is broken up into 4 separate blocks; base being the core o/s. Select all four as we'll be wanting all the tools to practice (otherwise you can choose 'base' and customise later). Step 4...

4. Install Packages

This will install ArchLinux to your target FileSystem, shouldn't take long; once done goto 5...

5. Configure System

Now configure your system, with most options choose the defaulty chosen options; afterwards your configuration will be written to the new system. Now onto the important step 6.

6. Install Bootloader

Now we'll install the bootloader to allow you to select on-bootup which O/S to start. Choose GRUB as your bootloader, you'll then be taken to the bootloader's config file.

Scroll down to the bottom of the file and uncomment the bottom entry until it resembles...

# (2) Windows Vista
title Windows Vista
rootnoverify (hd0,0)
makeactive
chainloader +1

This will add to your selection list an entry pointing to your first partition so you can select to boot Vista. Scroll up to the top of the file and check these lines, adjust as appropriately...

  • timeout 5 ...this sets the seconds to wait until booting the default entry

  • default 1 ...once the timeout expires GRUB will boot the option 1, ArchLinux, if you want to boot Vista instead, change it to 2.

  • fallback 0 ...if the default can't be booted, the fallback will be started, in this case the ArchLinux FallBack system created when we just installed ArchLinux (think of it as it's Linux's safe-mode, only much more powerful).

If you're happy with the setup, press CTRL+X to save the file and continue.

You'll next be asked where to place the Bootloader, we want to place it inside the MBR of the Drive so it will be launched when the disc spins up. The MBR is the first sector of the Hard Drive and commonly called the Master Boot Record.

You'll be presented with probably 3 options...

/SDA
/SDA1
/SDA2

Choose the first, this will be where the MBR is located.

Now you're finished, exit the Installer by selecting Exit Install, then type REBOOT to reboot.

The computer should restart and present you with the GRUB bootloader menu, where you'll now be able to select which O/S to start; job done.

Setting ROOT Password

Please note that with this initial install your ROOT account won't have a password assigned to it, posing a poblem later on down the line.

So when you've booted into ArchLinux, and typed 'root' as the username and hit ENTER to login, type...

passwd

To set the 'root' account's password.

Changing The Config

To edit the GRUB config later on, do...

nano /boot/grub/menu.lst

Settings

So as you know, the system config files are located in...

  • /etc/rc.conf (main system config)
  • /boot/grub/menu.lst (grub boot menu)
  • /etc/lilo.conf (lilo boot menu)
  • /etc/mkinitrd.conf
  • /etc/hosts
  • /etc/fstab
  • /etc/modprobe.conf
  • /etc/modules.conf
  • /etc/resolv.conf
  • /etc/conf.d/*
  • /etc/profile

ArchLinux Rocks!

Posted by John
on Thursday, 20 March 2008

ArchLinux

Seriously, how good is this Linux distribution. It's on a rolling release so you never need to worry about release numbers (7.04, 8.10, etc.) and it's so light and tightly put together, just excellent.

I installed a dual-boot install on my new HP laptop with Vista + ArchLinux using GRUB in about 5 minutes, really impressed about the intelligence of this build; well done to all involved.

Also for learning Linux it's got to be the best one to choose, ok it's a toughie with it's command-line install but with a 120mb install and creation of a rescue system incase you screw it up I've seriously grown to like it a lot; totally my favourite Linux distribution.