Showing posts with label VMware. Show all posts
Showing posts with label VMware. Show all posts

Saturday, November 29, 2008

VMware Server 2.0 under Ubuntu Intrepid Ibex

Following my Ubuntu Linux router upgrade project, and my "Ubuntu Hardy Heron under VMware" post, I felt it was time to swap things around and run VMware Server 2.0 under Ubuntu Intrepid Ibex (8.10).

The goal is to run one of the virtual machines I need to keep running quite often on my Shuttle K-4500-N2 which is being used as my router and left running all the time anyway. While it's not exactly a high-performance machine, it should suffice for the virtual machine I'm looking to move, which operates fine with only 256 MB RAM. This will allow me to keep my regular desktop powered off more, and save some power.

vsock Installation Issue

The first issue I had with the host installation under Ubuntu Intrepid Ibex was an issue with building the "vsock" module:

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

Extracting the sources of the vsock module.

Building the vsock module.

Using 2.6.x kernel build system.
make: Entering directory `/tmp/vmware-config0/vsock-only'
make -C /lib/modules/2.6.27-7-generic/build/include/.. SUBDIRS=$PWD SRCROOT=$PWD/. modules
make[1]: Entering directory `/usr/src/linux-headers-2.6.27-7-generic'
  CC [M]  /tmp/vmware-config0/vsock-only/linux/af_vsock.o
  CC [M]  /tmp/vmware-config0/vsock-only/linux/driverLog.o
  CC [M]  /tmp/vmware-config0/vsock-only/linux/util.o
/tmp/vmware-config0/vsock-only/linux/util.c: In function âVSockVmciLogPktâ:
/tmp/vmware-config0/vsock-only/linux/util.c:157: warning: format not a string literal and no format arguments
  CC [M]  /tmp/vmware-config0/vsock-only/linux/vsockAddr.o
  LD [M]  /tmp/vmware-config0/vsock-only/vsock.o
  Building modules, stage 2.
  MODPOST 1 modules
WARNING: "VMCIDatagram_CreateHnd" [/tmp/vmware-config0/vsock-only/vsock.ko] undefined!
WARNING: "VMCIDatagram_DestroyHnd" [/tmp/vmware-config0/vsock-only/vsock.ko] undefined!
WARNING: "VMCI_GetContextID" [/tmp/vmware-config0/vsock-only/vsock.ko] undefined!
WARNING: "VMCIDatagram_Send" [/tmp/vmware-config0/vsock-only/vsock.ko] undefined!
  CC      /tmp/vmware-config0/vsock-only/vsock.mod.o
  LD [M]  /tmp/vmware-config0/vsock-only/vsock.ko
make[1]: Leaving directory `/usr/src/linux-headers-2.6.27-7-generic'
cp -f vsock.ko ./../vsock.o
make: Leaving directory `/tmp/vmware-config0/vsock-only'
Unable to make a vsock module that can be loaded in the running kernel:
insmod: error inserting '/tmp/vmware-config0/vsock.o': -1 Unknown symbol in module
There is probably a slight difference in the kernel configuration between the
set of C header files you specified and your running kernel.  You may want to
rebuild a kernel based on that directory, or specify another directory.

The VM communication interface socket family is used in conjunction with the VM
communication interface to provide a new communication path among guests and
host.  The rest of this software provided by VMware Server is designed to work
independently of this feature.  If you wish to have the VSOCK feature  you can
install the driver by running vmware-config.pl again after making sure that
gcc, binutils, make and the kernel sources for your running kernel are
installed on your machine. These packages are available on your distribution's
installation CD.
[ Press the Enter key to continue.]

I found a solution to this posted on the Ubuntu Forums: "VMware server 2 vsock warning", specifically the patch to "vmware-config.pl" posted by "delgurth" on 2008-11-28: http://ubuntuforums.org/showpost.php?p=6267637&postcount=17.

Web Interface

I've been using the VMware Server 1.x versions on my Windows desktop and some other machines for quite some time, and things have worked quite well. The 2.0 version is quite an upgrade, and one that I first tested on my Windows desktop. While it brings many new features, I, like many others, was disappointed in the migration to - and apparent requirement to use - the web-based interface.

Included in the issues against the web interface is an issue with SSL certificates. For one, the server certificates are self-signed, which causes various warnings and issues under any browser, but these are common and somewhat-easily worked around. (See also: "Firefox SSL-Certificate Debate Rages On", 2008-08-22, slashdot.org.)

However, there is also an issue where client certificates are continuously prompted for. On the Windows host, I simply avoided this by connecting to the HTTP port (8222) instead of HTTPS (port 8333). The Linux host installation, however, redirects any HTTP requests to HTTPS. The 2 most informative search results I found were on the VMware forums: "VI constantly asks for Client Certificates?" and "identify yourself with a certificate". Unfortunately, I didn't have success with any of the listed suggestions.

Fortunately, the "VMware Infrastructure Client" can be used to connect instead, very similar to the "VMware Server Console" in the 1.x versions. From a Windows install, the client installation is located at "\VMware\VMware Server\hostd\docroot\client\VMware-viclient.exe" underneath Program Files. In order to get it to connect, I had to suffix the port number to the host name (:8333). It also seems to connect to the HTTPS port only, not HTTP.

Unfortunately, the VMware Infrastructure Client seems to have a few issues of its own. For one, I can't keep a console window open for a VM without keeping the main "VMware Infrasturcture Client" open as well. Additionally, it seems that some settings are only available under the web interface, or at least some settings that only work underneath the web interface. For example, when trying to configure the amount of "Reserved Memory" after going into maintenance mode, I get an error: "A specified parameter was not correct. spec.virtualMachineReserved". Configuring the same option through the web UI does work, however.

I was happy to see that the web UI was standardized across operating systems since the 1.x version. Previously, Microsoft IIS was required for any web management under Windows. While this worked well for me under Windows Server 2003 environments, it didn't work so well under Windows XP Professional, where there is a limit of only one operational virtual web site at a time. (See also: "IIS5.1 in XP Pro", Brett Hill, 2002, iisanswers.com.) While this may be fine for a dedicated VMware host, it prevents the use of the "Default Web Site" or any other desired sites.

Now, Apache Tomcat & Java are used. Unfortunately, continually running the web access service consumes ~100 MB of RAM. This is to significant of a waste for me for a process that is only going to be seldom used, especially on a machine that only has a maximum of 2 GB RAM available to begin with (which includes shared video memory). If the other issues were fixed, and/or if VMware made it easy to reuse existing Java/Tomcat instances instead of installing their own, I may reconsider.

Final Thoughts

I've been hearing more and more good things about VirtualBox, now developed by Sun Microsystems. I plan on giving it a try...

Thursday, May 29, 2008

Ubuntu Hardy Heron under VMware

I just got the latest Ubuntu Linux distribution (8.04, "Hardy Heron") working quite well under VMware.

I found a few issues during the process specific to running under VMware that required some attention. Google helped me find the solution for the first two both on Peter Cooper's blog:

Mouse scroll wheel

First, the scroll wheel on the mouse wasn't working. Not so surprising, as I've typically had various mouse problems in the past working with Linux versions under VMware. The solution Peter found was to add the following highlighted three lines in "/etc/X11/xorg.conf":

Section "InputDevice"
Identifier "Configured Mouse"
Driver "vmmouse"
Option "CorePointer"
Option "Device" "/dev/input/mice"
Option "Protocol" "ImPS/2"
Option "Buttons" "5"
Option "ZAxisMapping" "4 5"
EndSection

For the original with full details, see How To Enable Mouse Wheel Scrolling in Ubuntu Hardy on VMware Fusion (Peter Cooper, 2008-04-26). While written for VMware Fusion, the solution works equally well for the free VMware Server.

VMware Tools

Next were some issues getting the VMware tools to install properly. The basic GUI vmware-toolbox worked, but no precompiled modules for the file sharing or network driver could be found for the current kernel. When it attempted to compile appropriate ones, gcc would error out with "conflicting types" messages.

This solution is a little more lengthy. Peter's instructions work quite well: How to Install VMware Tools on Ubuntu Hardy 8.04 under VMware Fusion (Peter Cooper, 2008-04-26).

The only alteration I made is using the most recent version of open-vm-tools from SourceForge - 2008.05.15 as of this writing. Again, this works just as well for VMware Server as for VMware Fusion, other than that VMware Server doesn't have support for the "Shared Folders" feature.

Unnecessary Services

Another optimization that can be made under VMware is disabling a number of services that don't function / simply don't exist under VMware.

Services can quickly be disabled using the "Services" applet under the System / Administration menu. The services I disabled:

  • Bluetooth device management (bluetooth)
  • CPU Frequency manager (powernowd)
  • Power management (acpid)
  • Power management (apmd)

Boot Details

Another non-VMware related change I wanted was to see more details during the boot process, which I was used to from previous versions.

Part of the challenge was finding the proper search terms. Ubuntu uses "Usplash" (see also USplash on help.ubuntu.com, and somewhat related to "Splashy") as the default "Bootsplash".

The best write-up I found related to this is Quickzi: Get rid of the Ubuntu splash screen during boot (author unknown, 2007-10-27, foogazi.com).

Essentially, to adjust the process permanently (at least until the next kernel upgrade), the file to edit is "/boot/grub/menu.lst". Find the "kernel" line in the config you are booting with and remove the "quiet" and/or "splash" options. My preference is to leave "splash" and just remove the "quiet", which scrolls the boot progress on the lower portion of the splash. (I wouldn't recommend removing "splash" and leaving "quiet".)

"Open Terminal" on desktop/context menu

Previous Linux distributions I had included a "Open Terminal" option on the desktop/context menu, and I found myself using it quite frequently and missing it in Ubuntu. To obtain this functionality, install "nautilus-open-terminal".

Friday, September 7, 2007

Customizing VMware Network Subnets

VMware Server is a great, currently free tool for creating a virtual computer environment, great for testing various operating systems and configurations, or for operating within a protected Sandbox.

One area where I feel that VMware Server could use some improvement involves the configuration of its virtual network segments on the host. During installation, the VMware installer creates 2 virtual network adapters, "VMnet1" and "VMnet8". Additional adapters can be configured for a total of up to 8 virtual networks. The default VMnet1 is a "host only" network, with no communication paths outside of the host computer and any virtual machines. The default VMnet8 is a "NAT" network, hosting a NAT service to share the host computer's network connection and default gateway.

Both the VMnet1 and VMnet8 networks are configured by default with 2 different, private random Class C networks, with the pattern of 192.168.x.0, where x is a random byte. As the Wikipedia article states, "Classful" networks are obsolete in favor of Classless Inter-Domain Routing (CIDR). Rather than having VMware configure itself to 8-bit boundaries and 24-bit prefixes, I figured I should be able to configure the VMware networks with variable-length subnet masking. Unfortunately, VMware doesn't provide a clear configuration path to accomplish this. Documentation is equally lacking, even within the VMware knowledge base and forums.

Before attempting to change the VMware network configuration, it is good practice to stop all related VMware Windows services. They can be restarted after configuration changes are complete:

  • VMware Authorization Service ("VMAuthdService")
  • VMware Registration Service ("vmserverdWin32", dependent on and will stop automatically with the above Authorization Service)
  • VMware DHCP Service ("VMnetDHCP")
  • VMware NAT Service ("VMware NAT Service")

This example calls for configuring VMnet1 to 192.168.192.0/25 and VMnet8 to 192.168.192.128/25. There are 3 places where configuration is needed:

  • The host network adapters:

    The typical TCP/IP configuration of the host adapters, accessed from "Network and Dial-up Connections". See Microsoft's page for details, if needed.

    For VMnet1, use IP Address 192.168.192.1, Subnet 255.255.255.128, and no default gateway. For VMnet8, use IP Address 192.168.192.129, Subnet 255.255.255.128, and no default gateway.

  • The registry:

    HKLM\SOFTWARE\VMware, Inc.\VMnetLib\VMnetConfig, subkeys vmnet1 and vmnet8. Each should already have an IPSubnetAddress String value. Set vmnet1's to 192.168.192.0 and vmnet8's to 192.168.192.128. Missing, and undocumented as far as I can tell, are the IPSubnetMask String values. Microsoft/Sysinternals' Regmon was useful in determining this value. Create new String values for each network subkey, and set both to 255.255.255.128.

    Also hidden away is HKLM\SYSTEM\CurrentControlSet\Services\VMnetDHCP\Parameters\VirtualEthernetSegments\x\HostIpAddress, where 'x' is '1' or '8', the number of the VMnet interface. These values are DWORDs, the 4 bytes stored as hexadecimal in reverse-byte order. I.E., 192.168.192.1 for VMnet1 is 0x01c0a8c0. Alternatively, the undocumented vnetlib tool in the VMWare Server program folder can be used, which automatically updates this and some of the other values: vnetlib -- update dhcp vmnetx, replacing vmnetx with the proper vmnet-name.

  • The file system:

    %AllUsersProfile%\Application Data\VMware\. The vmnetdhcp.conf file needs to be edited, with the pertinent changes highlighted:

    vmnetdhcp.conf:

    #
    # Configuration file for VMware port of ISC 2.0 release running on
    # Windows.
    #
    # This file is generated by the VMware installation procedure; it
    # is edited each time you add or delete a VMware host-only network
    # adapter.
    #
    # We set domain-name-servers to make some clients happy
    # (dhclient as configued in SuSE, TurboLinux, etc.).
    # We also supply a domain name to make pump (Red Hat 6.x) happy.
    #
    allow unknown-clients;
    default-lease-time 1800;                # default is 30 minutes
    max-lease-time 7200;                    # default is 2 hours
    
    # Virtual ethernet segment 1
    subnet 192.168.192.0 netmask 255.255.255.128 {
    range 192.168.192.2 192.168.192.126;            # default allows up to 125 VM's
    option broadcast-address 192.168.192.127;
    option domain-name-servers 192.168.192.1;
    option domain-name "localdomain";
    default-lease-time 1800;
    max-lease-time 7200;
    }
    host VMnet1 {
        hardware ethernet 00:50:56:C0:00:01;
        fixed-address 192.168.192.1;
        option domain-name-servers 0.0.0.0;
        option domain-name "";
    }
    # End
    
    # Virtual ethernet segment 8
    subnet 192.168.192.128 netmask 255.255.255.128 {
    range 192.168.192.131 192.168.192.254;            # default allows up to 125 VM's
    option broadcast-address 192.168.192.255;
    option domain-name-servers 192.168.192.130;
    option domain-name "localdomain";
    option netbios-name-servers 192.168.192.130;
    option routers 192.168.192.130;
    default-lease-time 1800;
    max-lease-time 7200;
    }
    host VMnet8 {
        hardware ethernet 00:50:56:C0:00:08;
        fixed-address 192.168.192.129;
        option domain-name-servers 0.0.0.0;
        option domain-name "";
        option routers 0.0.0.0;
    }
    # End
    

    vmnetnat.conf: The ip variable under the [host] section in this file may also need to be edited, though I've not seen this variable take effect either way.

Here is a table describing the IP network layout for both interfaces, using the above configuration:

IP Config VMnet1 VMnet8
Network Subnet Address: 192.168.192.0 192.168.192.128
Network Subnet Mask: 255.255.255.128 255.255.255.128
Network Broadcast Address: 192.168.192.127 192.168.192.255
Network - CIDR Notation: 192.168.192.0/25 192.168.192.128/25
Host IP Address: 192.168.192.1 192.168.192.129
Default Gateway / NAT Server Binding: N/A 192.168.192.130

Restart the services and hopefully everything will work smoothly. Good luck!

Response to the anonymous comment left August 7, 2008 7:21 AM:

Comments such as this make me rethink allowing anonymous comments. Posting anonymously certainly doesn't help credibility.

This post details the free VMware Server edition. Other editions may provide more/better configuration options.

Within VMware Server, the related configuration pretty much allows as follows:

  1. Host Virtual Adapters: This tab simply allows for additions and deletions of virtual adapters. No properties are offered. When added, a random Class C network is configured, with a network ID of 192.168.x.0, where x is a random byte. As described above, further configurations must be made through the Windows properties.
  2. DHCP: Simply allows for configuration of the start and end IP addresses for the leases. Subnet, Netmask, and Broadcast address are all greyed-out/disabled, and must be configured using the methods described above.
  3. NAT: Simply allows for configuration of the Gateway IP address. The Netmask field is the only other IP addressing configuration displayed, and is also greyed-out/disabled. Further configuration must be made using the methods described above.

If I'm missing something, please feel free to email me, or post a more detailed comment as a logged-in user. Links to instructions and/or screenshots would also be noteworthy.