My ongoing experiences with Ubuntu, and later Mythbuntu, as a media center with MythTV. I'm also using the system for a virtual machine server, a mediawiki server and a general all around home infrastructure base.

Sunday, January 25, 2009

Cloning a Ubuntu VM

I haven't yet found a good set of directions on the net for cloning a Ubuntu VM. These directions are for cloning a 8.04 Ubuntu server VM (it happens to also be running in a Ubuntu server, but these should work for any linux server).

These directions assume your VMs use static IP addresses and you want to clone an existing VM called "myvm" to a new VM called "mynewvm" with its own IP address.

Make sure "myvm" has no snapshots, as this method won't work on a VM with snapshots (the disk rename step will fail).

Also make sure you close the original VM in VMWare-Server or you may get file-locking problems.


Ok, first change to the directory where the original VM is stored and copy the directory (this will take a few minutes):
cd /usr/lib/Virtual Machines
cp -ax myvm mynewvm

Now rename the disk:
cd mynewvm
/usr/bin/vmware-vdiskmanager -n myvm.vmdk mynewvm.vmdk

Now rename the configuration file and change the name of the VM in the file:
mv myvm.vmx mynewvm.vmx
sed -i "s/myvm/mynewvm/" mynewvm.vmx

Now in VM-Ware server, select "File" then "Open" and "Browse". Select the "mynewvm" directory and the "mynewvm.vmx" file in that directory. The new VM should appear in the Inventory list.

Select the new VM and boot it. At this point it won't appear on the network. You'll need to log into the console as root and do the following:

rm /etc/udev/rules.d/70-persistent-net.rules

At this point, you could reboot the VM and it will come back up with original IP and hostname, which will cause a conflict if the original VM is also on the network, so you might just want to go ahead and do the following while you're hear:

Change the hostname by editing /etc/hostname.

Then edit /etc/network/interfaces and change the 'address' line to reflect the new IP address you want the VM to have.

Finally, etc /etc/hosts, change the line for '127.0.1.1' to reflect the new hostname and add (probably at the end of the file, but really where ever you want) a new line for the new hostname, e.g/:

192.168.1.50  mynewvm

That should do it. Now just reboot the VM and it should come back up with the new IP and hostname.

Monday, January 19, 2009

Installing Eclipse on 8.10 Desktop

Straight forward following these directions. I already had the OpenJDK Java Runtime installed. The Eclipse download took about 30 minutes.

Sunday, January 18, 2009

Installing Skype on 8.10 Desktop and getting it to work with Logitech Headset

Installing Skype on a Ubuntu 8.10 desktop turns out to be a piece of cake, getting it to work with my Logitech USB Headset was a little harder.

Installation of Skype was easy following these directions. First, I edited /etc/apt/sources.list to include the Skype repository:

# vi /etc/apt/sources.list
# tail -3 /etc/apt/sources.list
# SKYPE
deb http://download.skype.com/linux/repos/debian/ stable non-free

Then I did the repository install and installed skype:
# apt-get update
# apt-get install skype

At this point Skype was installed and appeared under Applications -> Internet -> Skype

But when I tried to make a call Skype reported "Problem with Audio Playback" and nothing worked.

Long story short, these directions finally worked for me, specifically, here are the devices I used:

Sound in: Logitech USB Headset (pluhw:Headset,0)
Sound out: Logitech USB Headset (hw:Headset,0)
Ringing: Logitech USB Headset (hw:Headset,0)

During the time I worked on this problem I restarted pulseaudio, I don't know if this helped or not, but I'll mention it just in case:
# killall pulseaudio
# /etc/init.d/pulseaudio start

Following is more details on things I saw and what didn't work.

If I run System -> Preferences -> Sound, I see both ALSA and OSS versions of the Headset, but only the OSS version works (the ALSO version returns the following error when I try to test it: "audiotestsrc wave=sine freq=512 ! audioconvert ! audioresample ! gconfaudiosink: Could not open audio device for playback.")

Trying to record with Applications -> Sound & Video -> Sound Recorder does not work.

"alsamixer -c 1" showed Logitech USB Headset, but I couldn't get anything further to work.

I tried these directions but I saw the same problem others did in that when I tried to remove pulseaudio, apt-get/aptitude wanted to remove ubuntu-desktop and I stopped there.

Here is the output from a couple commands:

# cat /proc/asound/cards 
 0 [ICH6           ]: ICH4 - Intel ICH6
                      Intel ICH6 with STAC9752,53 at irq 16
 1 [Headset        ]: USB-Audio - Logitech USB Headset
                      Logitech Logitech USB Headset at usb-0000:00:1d.3-2, full speed

# cat /proc/asound/devices
  2:        : timer
  3:        : sequencer
  4: [ 0- 4]: digital audio playback
  5: [ 0- 3]: digital audio capture
  6: [ 0- 2]: digital audio capture
  7: [ 0- 1]: digital audio capture
  8: [ 0- 0]: digital audio playback
  9: [ 0- 0]: digital audio capture
 10: [ 0]   : control
 11: [ 1- 0]: digital audio playback
 12: [ 1- 0]: digital audio capture
 13: [ 1]   : control