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.

Showing posts with label vmware. Show all posts
Showing posts with label vmware. Show all posts

Sunday, June 14, 2009

Uninstalling VMWare 2.0.1, installing VMWare 1.0.9 on Ubuntu 9.0.4

I had previously installed VMWare 2.0.1 and I hate it. I'm probably going to move to VirtualBox, but I need VMWare for a while until I transition, so I decided to take another run at getting VMWare 1.0.9 to install.

First, to uninstall VMWare 2.0.1:
# /usr/bin/vmware-uninstall.pl
Then I downloaded VMWare 1.0.9 from the VMWare website.

Previously I had run into this bug which caused the vmmon build to fail.

The trick to getting it to build is to use this patch following the directions from this tutorial, which worked for me despite it being for an older version.

Sunday, May 3, 2009

Installing VMServer 2.0.1

Having just upgraded to 9.04, it seemed like a good time to catch up on my VMWare server upgrades, since I was still on 1.0.7, which is getting a little old.

I started by trying to upgrade to 1.0.9, but I could not get the vmmon module to build...

So, I shifted gears and tried installing 2.0.1 following the directions at VMWare Server 2.01 on Ubuntu 9.04.

I downloaded the 2.0.1 tarball and tried installing it following those directions.
$tar xvfz ~/Downloads/VMware-server-2.0.1-156745.i386.tar.gz
$cd vmware-server-distrib/
$patch ./bin/vmware-config.pl ~/Downloads/vmware-config.pl.patch.txt
$sudo ./vmware-install.pl
I took the default answers except for the following:
Your computer has multiple ethernet network interfaces available: eth0, pan0,
wlan0. Which one do you want to bridge to vmnet0? [eth0] wlan0

The current administrative user for VMware Server is ''. Would you like to
specify a different administrator? [no] yes
Please specify the user whom you wish to be the VMware Server administrator
von
I actually goofed typing in my serial number, but looks like my existing VMServer 1.0 license worked.

Saturday, April 25, 2009

Upgrading Ubuntu 8.04 Desktop VM to 9.04

Short version: Don't try upgrading a 8.04 Ubuntu Desktop VM with only 4GB of disk to 8.10 - there isn't enough disk space.

I decided to start playing with Ubuntu 9.04 by upgrading a 8.04 Ubuntu Desktop VM I had. Since it was two version behind I followed the upgrade directions to bring it up to 8.10 first. A key bit in the directions is opening Software Sources and selecting "Normal releases" under the Updates tab, otherwise Update Manager won't show the update version.

I fired up the Update Manager, upgraded a number of packages, and then fired up the upgrade to 8.10. Unfortunately it died with the following message:
The upgrade aborts now. The upgrade needs a total of 649M free space on disk '/'. Please free at least an additional 243M of disk space on '/'. Empty your trash and remove temporary packages of former installations using 'sudo apt-get clean'.
So I did as it suggested and ran 'apt-get clean', which seemed to free up ~720MB of disk space:
# apt-get clean
# df -k
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/sda1 3920768 2993528 729644 81% /
...
Now I trued Update Manager again, but it failed again with a similar message:
The upgrade aborts now. The upgrade needs a total of 975M free space on disk '/'. Please free at least an additional 306M of disk space on '/'. Empty your trash and remove temporary packages of former installations using 'sudo apt-get clean'.
So now I need 975MB of space. I give up.

Lesson learned, give Ubuntu more than 4GB if you think you might want to upgrade it.

Friday, April 24, 2009

New VM checklist

Things to do in a new Ubuntu VM after I create it:
  1. Install a apt-cacher proxy. This involved editing /etc/hosts to add the caching host and then creating /etc/apt/apt.conf.d/90local-proxy with contents of: Acquire::http::Proxy "http://cache-host:3142";
  2. Install vmware-tools.
That's it for now.

Upgrading Ubuntu server VMs from 8.10 to 9.04

After my first attempt to upgrade a Ubuntu VM desktop image didn't work work due to lack of disk space, I decided to try my Ubuntu server VMs, which I had previously upgraded to 8.10.

I started by backing up the virtual machines (basically shut them down and tar'ed them up). Then I followed the direction for doing a network upgrade for Ubuntu servers. BTW, this took a while, I should have done it inside a screen session.

# apt-get install update-manager-core
Reading package lists... Done
Building dependency tree
Reading state information... Done
update-manager-core is already the newest version.
Presumably I did that during the 8.10 upgrade, so on to step 2:
# do-release-upgrade
Checking for a new ubuntu release
Done Upgrade tool signature
Done Upgrade tool
Done downloading
extracting 'jaunty.tar.gz'
authenticate 'jaunty.tar.gz' against 'jaunty.tar.gz.gpg'

...a few minutes go by here...

1 package is going to be removed. 23 new packages are going to be
installed. 270 packages are going to be upgraded.

You have to download a total of 188M. This download will take about
15 minutes with your connection.

Fetching and installing the upgrade can take several hours. Once the
download has finished, the process cannot be cancelled.

Continue [yN] Details [d]y
Fetching

...25 minutes of downloading go by here...
At this point installs started and I answered various questions. I won't mention all of them, just hit the highlights...

I kept my version of the following files:
  • /etc/apache2/ports.conf and /etc/apache2/sites-available/default
  • /etc/apt/apt.conf.d/50unattended-upgrades
  • smb.conf
I went ahead and said "yes" to "17 packages are going to be removed."

Then I went ahead and answered yes to reboot and when the VM came back up, all looked good.

$ cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=9.04
DISTRIB_CODENAME=jaunty
DISTRIB_DESCRIPTION="Ubuntu 9.04"
VMWare tools were even running:

$ ps auxwww | grep vmware
root 2448 0.3 0.1 2204 660 ? Ss 22:21 0:02 /usr/sbin/vmware-guestd --background /var/run/vmware-guestd.pid
That's it.

Upgrading another VM, I saw the following message, which I thought was interesting. I went ahead and said "y":
Continue running under SSH?

This session appears to be running under ssh. It is not recommended
to perform a upgrade over ssh currently because in case of failure it
is harder to recover.

If you continue, a additional ssh daemon will be started at port
'9004'.
Do you want to continue?

Sunday, March 29, 2009

host clock rate changes again

Updated April 16, 2009: And the answer is running 'vmware-config.pl', which I did recently after a kernel update, causes the 'host.useFastClock = FALSE' line to disappear from /etc/vmware/config.

Original post follows...

Argh, once again my syslog on my VMWare server was getting filled up with host clock rate change messages:
# tail /var/log/syslog
Mar 29 08:31:46 casey kernel: [1894820.064260] [925]: host clock rate change request 54 -> 58
Mar 29 08:31:57 casey kernel: [1894831.040153] [925]: host clock rate change request 58 -> 24
Mar 29 08:31:57 casey kernel: [1894831.040272] [925]: host clock rate change request 24 -> 54
Mar 29 08:31:59 casey kernel: [1894832.676158] [925]: host clock rate change request 54 -> 58
Once again "host.useFastClock = FALSE" was missing from /etc/vmware/config

Once again, I added it and restarted vmware (/etc/init.d/vmware restart).

Once again, this cleared up the problem.

I decided to add a daily check for this line to try and figure out why it disappears:
# vi check-vmware-config
# cat /etc/cron.daily/check-vmware-config
#!/bin/sh
grep "useFastClock" /etc/vmware/config > /dev/null
if test $? -ne 0 ; then
echo "WARNING: useFastClock line not found in /etc/vmware/config"
fi
# chmod +x /etc/cron.daily/check-vmware-config
Nothing to do now but sit back and wait....

Saturday, January 31, 2009

Kernel updates and VMWare

I've noticed every time my kernel is updated, I have to rerun '/usr/bin/vmware-config.pl' before VMWare will start. So far I've always been able to just take the default options.

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.

Friday, January 2, 2009

My Mythbuntu box hung and host clock rate change requests again...

I went to remotely log into my mythbuntu box today and found it was hung....

A quick power cycle and it came back up, now to poke around the log and figure out why...

Last message in kern.log and syslog wasn't very useful:
Dec 31 13:14:54 casey kernel: [2612801.476210] [3224]: host clock rate change request 36 -> 26

Hmmm, besides the fact my log files are filled with host clock rate change requests, which I've seen before, no clue as to why the system was hung.

Anyway, to fix the host clock rate change message, I checked /etc/vmware/config and yep, "host.useFastClock = FALSE" was missing. So I re-added it and restarted vmware ('/etc/init.d/vmware restart').

I still have no idea what caused the box to hang though.

Saturday, December 13, 2008

USB devices not appearing in VMs

Hmmm, I went to use a USB device in my Win XP win and it wasn't showing up (Under VM/Removable Devices/USB Devices). This sure seems familiar but I can't find a blog post about it. A quick google turned up this hint which I really remember doing before. In fact I have a /etc/init.d/mountdevsubfs.sh.dpkg.old file with the changes applied, so I know I did.

However when I re-applied those changes I got an error running the script (see end of post).

Poking around a little more I found this advice which seemed cleaner, except it was a little flawed, when I tried adding the line as given to /etc/fstab, it didn't help and I noticed that if I actually tried to invoke the line, I got the following error:

# mount /proc/bus/usb
[mntent]: line 10 in /etc/fstab is bad

The "usbfs" on the begining seemed wrong to me, so I dropped that, resulting in the following line:

/dev/bus/usb /proc/bus/usb usbfs auto 0 0

Then I restarted VMWare ("/etc/init.d/vmware restart") and my USB devices appeared!


Changes I made to /etc/init.d/mountdevsubfs.sh:

# diff -c mountdevsubfs.sh.orig mountdevsubfs.sh
*** mountdevsubfs.sh.orig 2008-12-13 08:19:38.000000000 -0600
--- mountdevsubfs.sh 2008-12-13 08:20:25.000000000 -0600
***************
*** 39,44 ****
--- 39,51 ----
   # Mount /dev/pts. Master ptmx node is already created by udev.
   #
          domount devpts "" /dev/pts devpts -onoexec,nosuid,gid=$TTYGRP,mode=$TTYMODE
+  #
+  # Magic to make /proc/bus/usb work so USB devices appear in VMWare
+  #
+  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
  }
  
  case "$1" in

Error from I got from those changes:
# /etc/init.d/mountdevsubfs.sh start
Usage: mount -V                 : print version
       mount -h                 : print this help
       mount                    : list mounted filesystems
       mount -l                 : idem, including volume labels
So far the informational part. Next the mounting.
The command is `mount [-t fstype] something somewhere'.
Details found in /etc/fstab may be omitted.
       mount -a [-t|-O] ...     : mount all stuff from /etc/fstab
       mount device             : mount device at the known place
       mount directory          : mount known device here
       mount -t type dev dir    : ordinary mount command
Note that one does not really mount a device, one mounts
a filesystem (of the given type) found on the device.
One can also mount an already visible directory tree elsewhere:
       mount --bind olddir newdir
or move a subtree:
       mount --move olddir newdir
One can change the type of mount containing the directory dir:
       mount --make-shared dir
       mount --make-slave dir
       mount --make-private dir
       mount --make-unbindable dir
One can change the type of all the mounts in a mount subtree
containing the directory dir:
       mount --make-rshared dir
       mount --make-rslave dir
       mount --make-rprivate dir
       mount --make-runbindable dir
A device can be given by name, say /dev/hda1 or /dev/cdrom,
or by label, using  -L label  or by uuid, using  -U uuid .
Other options: [-nfFrsvw] [-o options] [-p passwdfd].
For many more details, say  man 8 mount .
ln: creating symbolic link `/dev/bus/usb/devices': File exists

Saturday, November 1, 2008

Getting VMWare back up and running under 8.10

After upgrading to 8.10 VMWare wasn't working. I started by following these directions to install VMWare server.

Following that, I upgraded vmware-tools on each vm using these directions (I couldn't find any explicitly for 8.10).

Note that you'll want to do this from the console, as you'll lose networking during the process.

I ran into the following problem at one point:

Error: Unable to execute "/usr/bin/vmware-uninstall-tools.pl.

Following the advice in this thread, I ran vmware-tools-distrib/bin/vmware-uninstall-tools.pl and though it returned a few errors itself, it cleared up the problem.

Things seemed to work OK, except the vmhgfs and vmxnet drivers both failed to build. I don't care about vmhgfs since I don't use shared folders, but vmxnet (the "fast network interface") sure sounds handy. So I hope to come back to this.

Sunday, September 28, 2008

/dev/vmon: host clock rate change request syslog messages

On my VMWare host system I was seeing frequent (2-3/minute) syslog messages like the following that was making my syslog really hard to view:

/dev/vmmon[12315]: host clock rate change request 26 -> 30


Searching around on the net, a number of other people have seen this problem. I tried several things before finding one that worked for me.

First that that didn't work for me, based on this thread, I tried removing powernowd ('apt-get remove powernowd') but that offered no change.

Next thing that didn't work, based on this blog page, I followed the advice on this vmware knowledge based page:

# cat /proc/cpuinfo | grep "MHz"
cpu MHz : 2400.000
# vi /etc/vmware/config
# tail -3 /etc/vmware/config
host.cpukHz = 2400000
host.noTSC = TRUE
ptsc.noTSC = TRUE


and restarted vmware ('/etc/init.d/vmware restart'), but no luck.

Finally, what worked, even though it wasn't supposed to solve my problem, was, based on this page, I added the following to/etc/vmware/config:

host.useFastClock = FALSE


and restarted vmware ('/etc/init.d/vmware restart'). And that did it! No more syslog message about clock rate changes.

To clean up, I re-installed powernowd ('apt-get install powernowd') and that didn't seem to have any ill effects. I left all the changes to /etc/vmware/config.

Sunday, September 14, 2008

Installing VMware sevrer on Ubuntu server

I had previously installed vmware-server 1.0.7 on by ubuntu laptop, so now I went to install it on my server system, but I ran into the following when vmware-config.pl was running:

None of the pre-built vmmon modules for VMware Server is suitable for your
running kernel. Do you want this program to try to build the vmmon module for
your system (you need to have a C compiler installed on your system)? [yes]

Using compiler "/usr/bin/gcc". Use environment variable CC to override.

Your kernel was built with "gcc" version "4.2.3", while you are trying to use
"/usr/bin/gcc" version "4.2.4". This configuration is not recommended and
VMware Server may crash if you'll continue. Please try to use exactly same
compiler as one used for building your kernel. Do you want to go with compiler
"/usr/bin/gcc" version "4.2.4" anyway? [no]


Ok, so off to the web for help and I came across this thread. I tried installing gcc-4.2.3 as suggested, but no luck:
# dpkg -i /var/cache/apt/archives/gcc_4%3a4.2.3-1ubuntu6_i386.deb
(Reading database ... 188652 files and directories currently installed.)
Preparing to replace gcc 4:4.2.3-1ubuntu6 (using .../gcc_4%3a4.2.3-1ubuntu6_i386.deb) ...
Removing old gcc doc directory.
Unpacking replacement gcc ...
Setting up gcc (4:4.2.3-1ubuntu6) ...

root@casey:/tmp/vmware-server-distrib# ls -l /usr/bin/gcc*
lrwxrwxrwx 1 root root 7 2008-09-14 16:28 /usr/bin/gcc -> gcc-4.2
-rwxr-xr-x 1 root root 206692 2008-03-11 04:37 /usr/bin/gcc-4.1
-rwxr-xr-x 1 root root 193372 2008-09-10 14:14 /usr/bin/gcc-4.2
-rwxr-xr-x 1 root root 16312 2008-03-11 04:32 /usr/bin/gccbug-4.1
-rwxr-xr-x 1 root root 2018 2007-06-04 19:59 /usr/bin/gccmakedep
root@casey:/tmp/vmware-server-distrib# gcc --version
gcc (GCC) 4.2.4 (Ubuntu 4.2.4-1ubuntu1)
Copyright (C) 2007 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.


So, I went with the comment from ztirffritz and build with gcc 4.2.4. So far it seems to be working.

Installing VMware server 1.07

I saw there was a new version (1.07) of vmware-server available, so I went ahead and pulled it down and installed it.

One thing I quickly figured out was you can't skip running /usr/bin/vmware-config.pl - if you do that you won't find the VMWare Server Console in your Applications menu. I did just take the default answer for everything.

Once that was done I tried firing up the Console, but it wouldn't start. No error message, it would just appear in the task list and then disappear. Trying to run it from the commandline resulted in the following error:
# /usr/bin/vmware
/usr/lib/vmware/bin/vmware: /usr/lib/vmware/lib/libgcc_s.so.1/libgcc_s.so.1: version `GCC_3.4' not found (required by /usr/lib/libcairo.so.2)
/usr/lib/vmware/bin/vmware: /usr/lib/vmware/lib/libgcc_s.so.1/libgcc_s.so.1: version `GCC_4.2.0' not found (required by /usr/lib/libstdc++.so.6)
/usr/lib/vmware/bin/vmware: /usr/lib/vmware/lib/libgcc_s.so.1/libgcc_s.so.1: version `GCC_3.4' not found (required by /usr/lib/libcairo.so.2)
/usr/lib/vmware/bin/vmware: /usr/lib/vmware/lib/libgcc_s.so.1/libgcc_s.so.1: version `GCC_4.2.0' not found (required by /usr/lib/libstdc++.so.6)
/usr/lib/vmware/bin/vmware: /usr/lib/vmware/lib/libgcc_s.so.1/libgcc_s.so.1: version `GCC_3.4' not found (required by /usr/lib/libcairo.so.2)
/usr/lib/vmware/bin/vmware: /usr/lib/vmware/lib/libgcc_s.so.1/libgcc_s.so.1: version `GCC_4.2.0' not found (required by /usr/lib/libstdc++.so.6)


Ok, time to google and, as usual, the net comes through.

# cd /usr/lib/vmware/lib
# mkdir bak
# mv libgcc_s.so.1/libgcc_s.so.1 bak


And all seems good now.

Time synchronization in VMs



This post is the wrong way to go about things, see this article for details, but basically what you want to do is make sure you have the following in the VM's .vmx file:

tools.syncTime = "TRUE"



I'm noticed some serious time drift in my VMs (almost a day over a couple of weeks). Since I'm not running VMWare tools (I'm not running X), I needed a way to keep things in sync.

According to this page, time is synchronized at boot, which seems to be true, but isn't enough in my case.

So as suggested on the page, I installed ntp, but apparently the ntp-simple package no longer exists:
# apt-get install ntp-simple
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package ntp-simple is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
However the following packages replace it:
ntp
E: Package ntp-simple has no installation candidate


So I installed ntp instead:
# apt-get install ntp


Then I edit /etc/ntp.conf to use all the North American servers:
# vi /etc/ntp.conf
# grep ^server /etc/ntp.conf
server ntp.ubuntu.com
server 0.north-america.pool.ntp.org
server 1.north-america.pool.ntp.org
server 2.north-america.pool.ntp.org
server 3.north-america.pool.ntp.org

Tuesday, August 19, 2008

Installing VMWare server

So, I wanted to play with virtual machines. I installed VMWare-server following the directions here. I ended up installing VMware-server version 1.0.6 and this was on my Ubuntu 8.04.1 Desktop system.

BTW, the apt-get approach did not work for me.

I then proceeded to download Ubuntu 8.04.1 Server and installed it in a new VM. (BTW, I did try installing a Ubuntu appliance, but I had problems with eth0 not showing up, which in retrospect I suspect might have been solved if I had followed the directions here.)

Installing VMWare Tools into the VM was also tricky. I suspect because it had a 2.6.24-19-server kernel and most of the directions out there are for older kernels. The directions I did find that worked are here.

That's it. Have to say, I'm fairly impressed so far.