Vmware Server on Fedora Core 6

I’ve just installed vmware on Fedora Core 6 without any hassles, this is how I did it.

  1. I knew that I needed the following packages so I installed these with yum before starting:
    1. kernel-devel
    2. gcc
    3. xinetd
  2. I ran yum update next, this is optional, but I think it is best to do this now because vmware builds a module for your kernel so you really want to grab any kernel updates now.
  3. I disabled the iptables firewall at this point, the machine is internal therefore it was not required:
        [root@zaphod init.d]# chkconfig iptables off
    
  4. reboot the machine
  5. There is a compile error while the config script builds the kernel module (this is with kernel version 2.6.18-1.2869.fc6). An empty file needs touching to fix this:
    touch /lib/modules/2.6.18-1.2869.fc6/build/include/linux/config.h
    
  6. Download and install the application, for reference I used the rpm named VMware-server-1.0.1-29996.i386.rpm
  7. Run vmware-config.pl, I accepted most of the defaults, the output of mine is shown below:
        [root@zaphod ~]# vmware-config.pl
        Making sure services for VMware Server are stopped.
        Stopping VMware services:
           Virtual machine monitor                                 [  OK  ]
           Bridged networking on /dev/vmnet0                       [  OK  ]
           Virtual ethernet                                        [  OK  ]
        Configuring fallback GTK+ 2.4 libraries.
        In which directory do you want to install the mime type icons?
        [/usr/share/icons]
        What directory contains your desktop menu entry files? These files have a
        .desktop file extension. [/usr/share/applications]
        In which directory do you want to install the application's icon?
        [/usr/share/pixmaps]
        Trying to find a suitable vmmon module for your running kernel.
        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.
        What is the location of the directory of C header files that match your running
        kernel? [/lib/modules/2.6.18-1.2869.fc6/build/include]
        Extracting the sources of the vmmon module.
        Building the vmmon module.
        Using 2.6.x kernel build system.
        make: Entering directory `/tmp/vmware-config1/vmmon-only'
        make -C /lib/modules/2.6.18-1.2869.fc6/build/include/.. SUBDIRS=$PWD SRCROOT=$PWD/. modules
        make[1]: Entering directory `/usr/src/kernels/2.6.18-1.2869.fc6-i686'
          CC [M]  /tmp/vmware-config1/vmmon-only/linux/driver.o
          CC [M]  /tmp/vmware-config1/vmmon-only/linux/hostif.o
          CC [M]  /tmp/vmware-config1/vmmon-only/common/cpuid.o
          CC [M]  /tmp/vmware-config1/vmmon-only/common/hash.o
          CC [M]  /tmp/vmware-config1/vmmon-only/common/memtrack.o
          CC [M]  /tmp/vmware-config1/vmmon-only/common/phystrack.o
          CC [M]  /tmp/vmware-config1/vmmon-only/common/task.o
          CC [M]  /tmp/vmware-config1/vmmon-only/common/vmx86.o
          CC [M]  /tmp/vmware-config1/vmmon-only/vmcore/moduleloop.o
          LD [M]  /tmp/vmware-config1/vmmon-only/vmmon.o
          Building modules, stage 2.
          MODPOST
          CC      /tmp/vmware-config1/vmmon-only/vmmon.mod.o
          LD [M]  /tmp/vmware-config1/vmmon-only/vmmon.ko
        make[1]: Leaving directory `/usr/src/kernels/2.6.18-1.2869.fc6-i686'
        cp -f vmmon.ko ./../vmmon.o
        make: Leaving directory `/tmp/vmware-config1/vmmon-only'
        The module loads perfectly in the running kernel.
        Do you want networking for your virtual machines? (yes/no/help) [yes]
        Configuring a bridged network for vmnet0.
        The following bridged networks have been defined:
        . vmnet0 is bridged to eth0
        All your ethernet interfaces are already bridged.
        Do you want to be able to use NAT networking in your virtual machines? (yes/no)
        [yes] no
        Do you want to be able to use host-only networking in your virtual machines?
        [no] no
        Extracting the sources of the vmnet module.
        Building the vmnet module.
        Using 2.6.x kernel build system.
        make: Entering directory `/tmp/vmware-config1/vmnet-only'
        make -C /lib/modules/2.6.18-1.2869.fc6/build/include/.. SUBDIRS=$PWD SRCROOT=$PWD/. modules
        make[1]: Entering directory `/usr/src/kernels/2.6.18-1.2869.fc6-i686'
          CC [M]  /tmp/vmware-config1/vmnet-only/driver.o
          CC [M]  /tmp/vmware-config1/vmnet-only/hub.o
          CC [M]  /tmp/vmware-config1/vmnet-only/userif.o
          CC [M]  /tmp/vmware-config1/vmnet-only/netif.o
          CC [M]  /tmp/vmware-config1/vmnet-only/bridge.o
          CC [M]  /tmp/vmware-config1/vmnet-only/procfs.o
          CC [M]  /tmp/vmware-config1/vmnet-only/smac_compat.o
          SHIPPED /tmp/vmware-config1/vmnet-only/smac_linux.x386.o
          LD [M]  /tmp/vmware-config1/vmnet-only/vmnet.o
          Building modules, stage 2.
          MODPOST
        WARNING: could not find /tmp/vmware-config1/vmnet-only/.smac_linux.x386.o.cmd for /tmp/vmware-config1/vmnet-only/smac_linux.x386.o
          CC      /tmp/vmware-config1/vmnet-only/vmnet.mod.o
          LD [M]  /tmp/vmware-config1/vmnet-only/vmnet.ko
        make[1]: Leaving directory `/usr/src/kernels/2.6.18-1.2869.fc6-i686'
        cp -f vmnet.ko ./../vmnet.o
        make: Leaving directory `/tmp/vmware-config1/vmnet-only'
        The module loads perfectly in the running kernel.
        Please specify a port for remote console connections to use [902]
        Stopping xinetd:                                           [  OK  ]
        Starting xinetd:                                           [  OK  ]
        Configuring the VMware VmPerl Scripting API.
        Building the VMware VmPerl Scripting API.
        Using compiler "/usr/bin/gcc". Use environment variable CC to override.
        Installing the VMware VmPerl Scripting API.
        The installation of the VMware VmPerl Scripting API succeeded.
        Generating SSL Server Certificate
        In which directory do you want to keep your virtual machine files?
        [/var/lib/vmware/Virtual Machines]
        The path "/var/lib/vmware/Virtual Machines" does not exist currently. This
        program is going to create it, including needed parent directories. Is this
        what you want? [yes]
        Please enter your 20-character serial number.
        Type XXXXX-XXXXX-XXXXX-XXXXX or 'Enter' to cancel:  XXXXX-XXXXX-XXXXX-XXXXX
        Starting VMware services:
           Virtual machine monitor                                 [  OK  ]
           Virtual ethernet                                        [  OK  ]
           Bridged networking on /dev/vmnet0                       [  OK  ]
        The configuration of VMware Server 1.0.1 build-29996 for Linux for this running
        kernel completed successfully.
    [root@zaphod ~]#
    
  8. Reboot the machine
  9. When it finishes booting you should have some vmware processes

I also installed the Web Management Interface, the steps involved were:

  1. Download the tarball. I grabbed VMware-mui-1.0.1-29996.tar.gz
  2. Extract it and cd into the vmware-mui-distrib directory
  3. Run ./vmware-install.pl. The output of mine is shown below:
    [root@zaphod vmware-mui-distrib]# ./vmware-install.pl
    Creating a new installer database using the tar3 format.
    You must read and accept the End User License Agreement to continue.
    Press enter to display it.
    VMWARE MASTER END USER LICENSE AGREEMENT
    Do you accept? (yes/no) yes
    Thank you.
    Installing the content of the package.
    In which directory do you want to install the binary files?
    [/usr/bin]
    What is the directory that contains the init directories (rc0.d/ to rc6.d/)?
    [/etc/rc.d]
    What is the directory that contains the init scripts?
    [/etc/rc.d/init.d]
    In which directory do you want to install the VMware Management Interface
    files? [/usr/lib/vmware-mui]
    The path "/usr/lib/vmware-mui" does not exist currently. This program is going
    to create it, including needed parent directories. Is this what you want?
    [yes]
    In which directory would you like to install the documentation files?
    [/usr/lib/vmware-mui/doc]
    The path "/usr/lib/vmware-mui/doc" does not exist currently. This program is
    going to create it, including needed parent directories. Is this what you want?
    [yes]
    The installation of VMware Management Interface 1.0.1 build-29996 for Linux
    completed successfully. You can decide to remove this software from your system
    at any time by invoking the following command:
    "/usr/bin/vmware-uninstall-mui.pl".
    Before running VMware Management Interface for the first time, you need to
    configure it by invoking the following command:
    "/usr/bin/vmware-config-mui.pl". Do you want this program to invoke the command
    for you now? [yes]
    Configuring httpd.conf to run Apache as:
    User: nobody and Group: nobody
    Set the number of minutes before a http session times out. (This is the length
    of time before someone connecting to VMware Management Interface will be logged
    out) [60]
    Generating SSL Server Certificate
       Starting httpd.vmware:                                  [  OK  ]
    The configuration of VMware Management Interface completed successfully.
    [root@zaphod vmware-mui-distrib]#
    
  4. The install should have started it ok, you can now browse to http://your.host.name:8222/

Both the web interface and vmware itself chkconfig themselves on so they should run ok at boot. I rebooted my machine now to check all was well.

Adjusting prefs from the command line

To adjust the various system preferences from the command line you need the systemsetup utility which ships with OSX Server although I’ve found some versions of OS X client have it installed in /System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/Support. On my G5 with Tiger (10.4.8) installed I used systemsetup-tiger and on my iMac (Intel) that was missing so I used systemsetup-panther which also worked.

You can adjust all sorts of things with the tool -help shows you all the options, I wanted to adjust sleep times. Below is an example session, showing the settings before and after I had made the change

# ./systemsetup-panther -getsleep
Sleep: Computer sleeps after 10 minutes
Sleep: Display sleeps after 10 minutes
Sleep: Disk sleeps after 10 minutes
# sudo ./systemsetup-panther -setcomputersleep 60
setcomputersleep: 60
# ./systemsetup-panther -getsleep
Sleep: Computer sleeps after 60 minutes
Sleep: Display sleeps after 10 minutes
Sleep: Disk sleeps after 10 minutes

Today’s del.icio.us bookmarks

Today’s del.icio.us bookmarks

SystemRescueCd PXE Boot

I’ve moved this post into a page specifically about the SystemRescueCd which can be found here.

Linux on Compaq EVO T20

I’ve recently spent some time trying to get linux running out of the embedded firmware on a Compaq Evo T20. I’ve succeeded with a lot of help from this page. I’ll be adding some notes on how I did it and how I used ThinStation to get the NX client in the firmware.

Network aliases

To add an alias to a network device on freebsd do this:

[root@book etc]# ifconfig fxp0 alias 10.0.0.2 netmask 255.255.255.255

Note: The netmask is always /32

To remove one do this:

# ifconfig fxp0 -alias 10.0.0.2

To add these to rc.conf do something like:

ifconfig_fxp0="inet 10.0.0.1  netmask 255.255.255.240"
ifconfig_fxp0_alias0="10.0.0.2 netmask 255.255.255.255"

RPM spec file conditionals

I never remember how to do this, if you need vendor specific bits inside a spec file (like init scripts etc) you can use this to do different things depending on vendor.

%if "%{_vendor}" == "suse"
  # Suse specific stuff
%endif
%if "%{_vendor}" == "redhat"
  # Redhat specific stuff
%endif

If…else works like this:

%if "%{vendor}" == "suse"
  # Suse specific stuff
%else
  # Redhat specific stuff
%endif

Smart rpm signature check disable

I’ve just hit a problem with smart, whenever I tried to upgrade a package on this machine I was presented with the error shown below. I’m not sure why smart is complaining about this, the public key is in my keyring already. Trying to set ‘gpgcheck = 0′ in the channel file and running a smart update didnt help, but running the command shown at the bottom did

Committing transaction...
warning: rpmts_HdrFromFdno: V3 DSA signature: NOKEY, key ID 5277a2fa
Trying to import the key 888366c05277a2fa from subkeys.pgp.net...
gpg: requesting key 5277A2FA from hkp server subkeys.pgp.net
gpg: key 5277A2FA: "Manfred Tremmel " not changed
gpg: Total number processed: 1
gpg:              unchanged: 1
The above GPG key has been imported successfully.
It is required to install this package:
        libvorbis-1.1.1-0.pm.0.i686.rpm
Do you want to trust this key forever?
You must verify the below fingerprint before answering.
pub   1024D/5277A2FA 1999-07-26 [expires: ????-??-??]
      Key fingerprint = 5296 01E5 5911 A1DC 93D4  45D5 8883 66C0 5277 A2FA
uid                  Manfred Tremmel
sub   3072g/81D6CA10 1999-07-26
If you answer "Yes" all other packages signed with this key will be installed automatically. (y/N): n
error: libvorbis-1.1.1-0.pm.0.i686.rpm: public key not available
Saving cache...
message1:~ #

To fix this problem turn off signature checking, this should only be considered a temporary fix however

smart config --set rpm-check-signatures=false

LDAP Authentication in Solaris 10

I’ve just been setting up a Solaris 10 machine to authenticate from a OpenLdap directory, this is the command I used to make it work, note that the IP on the end is the IP of the directory server

# ldapclient manual -v \\
       -a defaultsearchbase=dc=riviera,dc=org.uk \\
       -a domainname=riviera.org.uk \\
       192.168.254.100

The output produced is shown below

Parsing defaultsearchbase=dc=riviera,dc=org.uk
Parsing domainname=riviera.org.uk
Arguments parsed:
        defaultSearchBase: dc=riviera,dc=org.uk
        domainName: riviera.org.uk
        defaultServerList: 192.168.254.100
Handling manual option
Proxy DN: NULL
Proxy password: NULL
Authentication method: 0
Authentication method: 0
No proxyDN/proxyPassword required
About to modify this machines configuration by writing the files
Stopping network services
Stopping sendmail
stop: sleep 100000 microseconds
stop: sleep 200000 microseconds
stop: sleep 400000 microseconds
stop: network/smtp:sendmail... success
Stopping nscd
stop: sleep 100000 microseconds
stop: system/name-service-cache:default... success
Stopping autofs
stop: sleep 100000 microseconds
stop: sleep 200000 microseconds
stop: sleep 400000 microseconds
stop: sleep 800000 microseconds
stop: sleep 1600000 microseconds
stop: sleep 3200000 microseconds
stop: system/filesystem/autofs:default... success
Stopping ldap
stop: sleep 100000 microseconds
stop: sleep 200000 microseconds
stop: network/ldap/client:default... success
nisd not running
nis(yp) not running
Removing existing restore directory
file_backup: stat(/etc/nsswitch.conf)=0
file_backup: (/etc/nsswitch.conf -> /var/ldap/restore/nsswitch.conf)
file_backup: stat(/etc/defaultdomain)=0
file_backup: (/etc/defaultdomain -> /var/ldap/restore/defaultdomain)
file_backup: stat(/var/nis/NIS_COLD_START)=-1
file_backup: No /var/nis/NIS_COLD_START file.
file_backup: nis domain is "riviera.org.uk"
file_backup: stat(/var/yp/binding/riviera.org.uk)=-1
file_backup: No /var/yp/binding/riviera.org.uk directory.
file_backup: stat(/var/ldap/ldap_client_file)=0
file_backup: (/var/ldap/ldap_client_file -> /var/ldap/restore/ldap_client_file)
file_backup: (/var/ldap/ldap_client_cred -> /var/ldap/restore/ldap_client_cred)
Starting network services
start: /usr/bin/domainname riviera.org.uk... success
start: sleep 100000 microseconds
start: sleep 200000 microseconds
start: sleep 400000 microseconds
start: sleep 800000 microseconds
start: sleep 1600000 microseconds
start: sleep 3200000 microseconds
start: sleep 6400000 microseconds
start: sleep 12800000 microseconds
start: sleep 25600000 microseconds
start: sleep 51200000 microseconds
start: network/ldap/client:default... success
start: sleep 100000 microseconds
start: sleep 200000 microseconds
start: sleep 400000 microseconds
start: system/filesystem/autofs:default... success
start: sleep 100000 microseconds
start: system/name-service-cache:default... success
start: sleep 100000 microseconds
start: sleep 200000 microseconds
start: sleep 400000 microseconds
start: network/smtp:sendmail... success
restart: sleep 100000 microseconds
restart: sleep 200000 microseconds
restart: milestone/name-services:default... success
System successfully configured
#

Then test that this is indeed working:

# grep rk295 /etc/passwd
# getent passwd | grep rk295
rk295:x:512:512::/home/rk295:/bin/bash
#

I found that after this had finished, hostname resolution no longer worked. Looking inside /etc/nsswitch.conf I found that the hosts entry had been changed to:

hosts:               ldap [NOTFOUND=return] files

I do not use LDAP for hostname resolution so I had to change this back to:

hosts:               files dns

And similarly the networks line was the same so I had to change that to use files dns as well.

At this point you can query LDAP using getent but you still need to configure PAM to use it for authentication etc. To do this you need to make some changes to /etc/pam.conf. Principally these changes involved telling it should fall back to LDAP if it doesnt match your credentials against the local files. My edited pam.conf is shown below, the lines which I have edited or added are shown in red.

#
#ident	"@(#)pam.conf	1.28	04/04/21 SMI"
#
# Copyright 2004 Sun Microsystems, Inc.  All rights reserved.
# Use is subject to license terms.
#
# PAM configuration
#
# Unless explicitly defined, all services use the modules
# defined in the "other" section.
#
# Modules are defined with relative pathnames, i.e., they are
# relative to /usr/lib/security/$ISA. Absolute path names, as
# present in this file in previous releases are still acceptable.
#
# Authentication management
#
# login service (explicit because of pam_dial_auth)
#
login	auth requisite		pam_authtok_get.so.1
login	auth required		pam_dhkeys.so.1
login	auth required		pam_unix_cred.so.1

login	auth sufficient		pam_unix_auth.so.1

login	auth required		pam_dial_auth.so.1

login	auth required 		pam_ldap.so.1

#
# rlogin service (explicit because of pam_rhost_auth)
#
rlogin	auth sufficient		pam_rhosts_auth.so.1
rlogin	auth requisite		pam_authtok_get.so.1
rlogin	auth required		pam_dhkeys.so.1
rlogin	auth required		pam_unix_cred.so.1

rlogin	auth sufficient		pam_unix_auth.so.1
rlogin	auth required 		pam_ldap.so.1

#
# Kerberized rlogin service
#
krlogin	auth required		pam_unix_cred.so.1
krlogin	auth binding		pam_krb5.so.1
krlogin	auth required		pam_unix_auth.so.1
#
# rsh service (explicit because of pam_rhost_auth,
# and pam_unix_auth for meaningful pam_setcred)
#
rsh	auth sufficient		pam_rhosts_auth.so.1
rsh	auth required		pam_unix_cred.so.1
#
# Kerberized rsh service
#
krsh	auth required		pam_unix_cred.so.1
krsh	auth binding		pam_krb5.so.1
krsh	auth required		pam_unix_auth.so.1
#
# Kerberized telnet service
#
ktelnet	auth required		pam_unix_cred.so.1
ktelnet	auth binding		pam_krb5.so.1
ktelnet	auth required		pam_unix_auth.so.1
#
# PPP service (explicit because of pam_dial_auth)
#
ppp	auth requisite		pam_authtok_get.so.1
ppp	auth required		pam_dhkeys.so.1
ppp	auth required		pam_unix_cred.so.1

ppp	auth sufficient		pam_unix_auth.so.1

ppp	auth required		pam_dial_auth.so.1

ppp	auth required 		pam_ldap.so.1

#
# Default definitions for Authentication management
# Used when service name is not explicitly mentioned for authentication
#
other	auth requisite		pam_authtok_get.so.1
other	auth required		pam_dhkeys.so.1
other	auth required		pam_unix_cred.so.1

other	auth sufficient		pam_unix_auth.so.1
other	auth required		pam_ldap.so.1

#
# passwd command (explicit because of a different authentication module)
#

passwd	auth sufficient		pam_passwd_auth.so.1
passwd	auth required 		pam_ldap.so.1

#
# cron service (explicit because of non-usage of pam_roles.so.1)
#
cron	account required	pam_unix_account.so.1
#
# Default definition for Account management
# Used when service name is not explicitly mentioned for account management
#

other	account sufficient 	pam_ldap.so.1

other	account requisite	pam_roles.so.1
other	account required	pam_unix_account.so.1
#
# Default definition for Session management
# Used when service name is not explicitly mentioned for session management
#
other	session required	pam_unix_session.so.1
#
# Default definition for  Password management
# Used when service name is not explicitly mentioned for password management
#
other	password required	pam_dhkeys.so.1
other	password requisite	pam_authtok_get.so.1
other	password requisite	pam_authtok_check.so.1
other	password required	pam_authtok_store.so.1
#
# Support for Kerberos V5 authentication and example configurations can
# be found in the pam_krb5(5) man page under the "EXAMPLES" section.
#

Now you should be able to su to a user whose credentials are stored only in ldap.