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)

Static IPs

Posted by John
on Saturday, 19 July 2008
/sbin/ifconfig eth0 192.168.1.101 netmask 255.255.255.0 broadcast 192.168.1.255

Network address by convention would be the lowest: 192.168.1.0 Broadcast address by convention would be the highest: 192.168.1.255 The gateway can be anything, but following convention: 192.168.1.1

Note: the highest and lowest addresses are based on the netmask. The previous example is based on a netmask of 255.255.255.0

also,

/usr/bin/neat  ..gnome gui tool
/usr/bin/netcfg  ..handles all network interfaces
/usr/sbin/system-config-network-tui  ...text user interface
/usr/sbin/netconfig  ..(Only seems to work for first network interface eth0 but not eth1,...)

The ifconfig command does NOT store changes permanently. On reboot changes are lost. Manually add your commands to the end of the file /etc/rc.d/rc.local to execute them upon boot.

Otherwise use the commands netcfg and netconfig, which make permanent changes to the system network configuration files located in /etc/sysconfig/network-scripts/

JAVA Alternatives

Posted by John
on Saturday, 19 July 2008

quick one, installing java

sudo apt-get install sun-java6-bin

select which java install to use (if have multiple versions)

sudo update-alternatives --config java

Fedora 9 wifi + flash on 64bit

Posted by John
on Monday, 14 July 2008

After getting back from vacation in Vegas I decided I needed to sort my laptop out once and for all. So partitioned the drive in two, one with Vista Ultimate and one with Fedora 9.

On top of this I really wanted the Fedora partition to be encrypted and using LVM so I can resize later, glad I did that.

However in all I had two problems along the way,

Fedora 9 Wifi doesn't support TKIP

The first thing which I couldn't fix was the Wifi. I was using WPA+TKIP which is available in the network configuration panel, all good but everytime I tried to connect it'd popup the password entry screen again; really annoying.

Thankfully I found the reason to this, Fedora 9 does not support TKIP even though it's available in the control panel; switching to WPA+AES clears that problem.

Just wish they documented that better ;-)

32-bit Flash on a 64-bit build

Adobe released the Flash 9 libraries to the linux community but only as 32-bit binaries, I installed Fedora using the 64-bit build so with some tweaking managed to fix that too.

In Terminal do:

su -c 'rpm -Uvh http://linuxdownload.adobe.com/adobe-release/adobe-release-i386-1.0-1.noarch.rpm'
su -c 'yum install flash-plugin'

Now specifically for 64-bit Fedora builds do:

su -c "yum -y install nspluginwrapper.{i386,x86_64} pulseaudio-libs.i386 libflashsupport.i386"
su -c 'mozilla-plugin-config -i -g -v'

Afterwards close & reopen Firefox and you should now have Flash 9 running on your Fedora 9 64-bit desktop.

Puppet - Setup / Test Notes

Posted by John
on Wednesday, 09 July 2008

'Put simply, Puppet is a system for automating system administration tasks'

Install

Depends on Ruby (at least 1.8.2), install with:

Client:

sudo aptitude install puppet facter

Server:

sudo aptitude install facter puppet puppetmaster

A Simple Manifest: Managing Ownership of a File

Step one: Create /etc/puppet/manifests/classes/sudo.pp
sudo nano /etc/puppet/manifests/classes/sudo.pp

class sudo {
    file { "/etc/sudoers":
        owner => "root",
        group => "root",
        mode  => 440,
    }
}
Step two: Create /etc/puppet/manifests/site.pp
sudo nano /etc/puppet/manifests/site.pp

import "classes/*"

node default {
    include sudo
}
Step three: Start the Puppetmaster
master % sudo puppetmasterd --mkusers

master % sudo /etc/init.d/puppetmaster restart  (for ubuntu / debian)
Step four: Run a client
client% sudo puppetd --verbose

master% sudo puppetca --list

master% sudo puppetca --sign <client>