VMware Guest Install

From SlackWiki
Jump to navigation Jump to search
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

HOWTO: Install Slackware 11.0 as a guest on VMWare Workstation for Windows 5.5 with:

  • a 2.6 kernel;
  • the ext3 filesystem;
  • the LSI Logic SCSI adapter;
  • and tips using XDMCP on the guest.

Prerequisites

  • Some previous experience installing any version of Slackware (no experience with 2.6 kernels necessary).
  • Some previous experience using VMware Workstation for Windows.
  • Experience using console-based editors such as Vi, pico, or Emacs.
  • Some degree of comfort using a bash prompt.

Tips and recommendations

  • Use the VMWare "snapshot" feature throughout the installation. That way, if you make a mistake, you won't have to start over from the beginning. I take a snapshot during each reboot. You can delete the snapshots after you're sure the installation is successful.
  • Make sure to install the Slackware 11.0 patches after successfully completing the installation.
  • This is not the only way to install Slackware 11.0 on a VMware guest. For example:
    • You don't have to run a 2.6 kernel if you don't want, the 2.4 kernel will work just fine. If you decide to use the 2.4 kernel, just skip the kernel upgrade step.
    • You can use the BusLogic SCSI adapter instead of the LSI Logic adapter, you'll just need to load the appropriate drivers for this adapter instead of the ones listed in the mkinitrd step.
    • You can use something other than ext3 for the filesystem (for example, ext2 or ReiserFS). If you do this, you'll need to load different drivers during the mkinitrd step.
    • Technically, you don't need to install the VMWare guest tools as covered here, but they are highly recommended as they greatly increase performance and usability (particularly when using X, or when running the guest from a laptop host).

Use the VMware new guest wizard to create the new guest

Use the following settings:

  • Custom
  • New – Workstation 5
  • Linux, Other Linux 2.6.x Kernel
  • Name your machine
  • 1 Proc
  • set memory not less than 256 MB
  • Use either bridged or NAT; I used NAT because bridged gave me problems with the wireless networking adapter on my laptop
  • LSI Logic adapter (you can use BusLogic, but you'll have to use different drivers than the ones listed here in the initrd configuration)
  • new virt disk
  • SCSI
  • Not less than 4GB
  • Name disk file

Install Slackware 11.0 on the guest

  1. Either insert the Slackware install CD in your CD-ROM drive, or add the Slackware install ISO as a new CD-ROM device in the guest configuration.
  2. Boot
  3. At the boot: prompt from Slackware install CD, type “raid.s”. This will start the installation with the 2.4 kernel & SCSI support for the VMware LSI SCSI adapter.
    • Note: I haven't figured out a way to install Slackware using the 2.6 kernel and/or installing the 2.6 kernel during the installation. The easiest way I can figure out how to do it is to install with the 2.4 kernel and then upgrade to 2.6 after installation is complete.
  4. create your partitions using: cfdisk /dev/sda.
    • You will need to create at least a swap partition and a root partition. My partition table usually looks something like this:
                       cfdisk 2.12r

                   Disk Drive: /dev/sda
              Size: 8589934592 bytes, 8589 MB
        Heads: 255   Sectors per Track: 63   Cylinders: 1044 

Name      Flags     Part Type  FS Type        [Label]       Size (MB)
---------------------------------------------------------------------
sda1                Primary    Linux swap                      296.12
sda2      Boot      Primary    Linux                          8291.09
  1. Start networking (network) if doing a network install from NFS. This will load the pcnet32 network driver.
  2. Start setup; set up your swap & root partitions, use ext3 for the partition type. Take note of the root partition device name. Set up your install source and package selections, and start the install.
  3. Things I know for sure you DON'T need to install for a guest to run correctly:
    • Package e (emacs)
    • Package f (faqs/howtos)
    • Package k (kernel source; this will be replaced anyway when we upgrade to 2.6)
    • Package kde and kdei (KDE)
    • Package t (TeX)
    • Package xap (but if you're using X at all, you'll probably want some of the things in there like a good window manager & desktop environment)
  4. Things I know for sure you DO need to install for a guest to run correctly:
    • Package x (X11) (the VMware-tools installation, while console-based, depends on X to complete the installation successfully. I imagine you can uninstall package X after the VMware-tools installation is complete).
  5. If you are installing from the ISO mapped to a virtual guest CDROM device, you'll need to switch to the second CD after the first CD is done (you'll receive a message to switch the CDs). To do this, right-click on the CD-ROM device icon in the lower-right corner of the VMWare status bar. Select edit, and change the ISO image location to the second ISO image.
  6. When configuring the options (after the package install) make sure to:
    • install the “raid.s” kernel to the hard drive.
    • Enable hotplug/udev system at boot.
    • Simple LILO install: Install LILO automatically
    • install LILO to the MBR
    • I use the standard Linux console, however some of the framebuffer modes do work.
    • ps2 port mouse
    • on startup services, make sure rc.pcmcia is unchecked (if this runs it causes a huge amount of kernel error messages and subsequent performance problems)
    • hardware clock is set to local time
  7. Reboot, not from the CD. If everything goes well you should get a regular console login prompt right after the message Welcome to Linux 2.4.33.3.
  8. If for some reason you didn't get the raid.s kernel installed and instead installed the default 2.4 kernel, you won't be able to boot because the SCSI driver will not load (you will instead get a message about not being able to mount the root device, followed by a kernel panic). Do this:
    • Boot from the installation CD and enter this at the boot: prompt:
    • raid.s root=/dev/[your_root_partition] noinitrd ro (where [your_root_partition] is the device name of the root partition (eg: /dev/sda1 or /dev/sda2 etc)).
    • Boot and continue at the next section.

Upgrade the kernel from 2.4 to 2.6

  1. log in as root
  2. Install the 2.6 kernel located in the patches or testing installation directory:
    • mount the installation CD or NFS mountpoint containing the Slackware 11.0 testing and/or patches directories (as of this writing, Slackware contains a 2.6 kernel in both testing and patches; the one in testing is a little newer).
    • Change to the patches/testing directory containing the linux 2.6 kernel installation .tgz files. Take note of the version number of the 2.6 kernel (ie: 2.6.18).
    • upgradepkg –-install-new kernel-generic*.tgz
    • upgradepkg –-install-new kernel-modules*.tgz
    • upgradepkg –-install-new kernel-source*.tgz (only if you want the source)
  3. cd /etc/rc.d
  4. rm rc.modules; ln -s rc.modules-[X] rc.modules
    • where [X] is the version number of your installed 2.6 kernel.
  5. Create the initrd filesystem with the ext3 and LSI Logic SCSI drivers:
    • mkinitrd -c -k [X] -m jbd:ext3:scsi_transport_spi:mptbase:mptscsih:mptspi -f ext3 -r /dev/[Y]
      • where [X] is the version of your 2.6 kernel and [Y] is the name of your root partition device.
      • the order of these modules (the ones separated by colons) is important.
      • if you're not using ext3, you won't need to load the ext3 or jdb modules (but you'll need to load the modules for your filesystem unless you're using ext2). You need the rest of the modules loaded for SCSI driver support, which you need to mount the VMware LSI scsi hard drive.
    • cat /boot/initrd-tree/load_kernel_modules and inspect to insure that all the modules listed in the mkinitrd command are correctly listed in this file.
  6. Edit the file /etc/lilo.conf, add the following after the image = line:
    • initrd = /boot/initrd.gz
  7. lilo
    • (you should receive the response Added Linux *)
  8. Reboot. If everything goes well, after bootstrap, you should receive the message Welcome to Linux [X], where [X] is the version of your 2.6 kernel, and a login prompt.

Build, install, and configure the VMware guest system tools

  1. Log in as root.
  2. From the VMware Workstation menu bar, choose VM->Install VMware tools
  3. From the linux bash prompt: mount /dev/cdrom /mnt/cdrom
  4. mkdir /tmp/toolsinstall; cd /tmp/toolsinstall
  5. tar zxf /mnt/cdrom/VMwareTools*.tar.gz
  6. Create the dummy System V init filesystem for the VMware-tools install program:
    • mkdir init.d
    • for i in {0,1,2,3,4,5,6}; do mkdir rc$i.d; done
    • touch init.d/network init.d/networking
  7. Bring down the networking so the install program can create the VMware high-performance network driver:
    • ifconfig eth0 down
    • rmmod pcnet32
  8. cd vmware-tools-distrib
  9. ./vmware-install.pl
    • For the options use the defaults; the only thing I change is the default bin directory from /usr/bin to /usr/local/bin
    • after answering all the configuration questions, vmware-install.pl will build and install all the VMware guest tools and update the dummy System V init filesystem.
  10. Move the changes in the dummy System V init filesystem into the Slackware BSD init scripts:
    • cp /tmp/toolsinstall/init.d/vmware-tools /etc/rc.d/rc.vmware-tools
    • sed -i "s/pcnet32/vmxnet/" /etc/rc.d/rc.netdevice
    • echo "/etc/rc.d/rc.vmware-tools start" >>/etc/rc.d/rc.local
  11. Reboot
  12. Directly before the Welcome to Linux 2.6.x message, you should see messages from the VMware-tools init script:
Starting VMware Tools services in the virtual machine:
    Switching to guest configuration:                 done
    Guest filesystem driver:                          done
    DMA setup:                                        done
    Guest operating system daemon:                    done

Welcome to Linux 2.6.18 (tty1)

virtslack2 login:

(Optional) Setting up XDMCP

If you want to use XDMP on the guest system, the following caveats apply:

  1. I recommend the xming X server over Cygwin/X. Cygwin/X doesn't seem to play well with VMware guests for some reason. I had problems with it gradually slowing down until the Cygwin X server would grind to a halt.
  2. If you're using NAT instead of bridging, make sure you set your -from parameter with the IP address of the VMware network adapter on the host system (on my system, this is 192.168.223.1; you can do an ipconfig on the host system to determine this IP address). If you don't do this step, you'll find performance to be abysmal.