VMware Linux Guest Setup Howto
This is a Howto wich decribes a setup of a Gentoo/Funtoo guest VM for VMware. It's not very Gentoo specific and you may use it also for other distros.
Always a good practice is to install the open-vm-tools.
The "vmmouse" driver is a bit more confortable than just "evdev" mouse driver - it's up to you to choose one.
Are there any failures on these settings? Or do you have some important informations for installing a VM? Please share it and post a comment below or send me an email.
1. Start
Create a new VM using VMware Workstation or use a generator wich you may find on several Internet sites. You can also use my Empty Linux VM. Then, you have to boot from a LiveCD ISO image or a bootable USB stick and setup the disk partitions like you would setup a real PC running Linux.2. VM hardware
The lspci command shows following hardware, wich may vary depending on the VM settings:00:00.0 Host bridge: Intel Corporation 440BX/ZX/DX - 82443BX/ZX/DX Host bridge (rev 01)
00:01.0 PCI bridge: Intel Corporation 440BX/ZX/DX - 82443BX/ZX/DX AGP bridge (rev 01)
00:07.0 ISA bridge: Intel Corporation 82371AB/EB/MB PIIX4 ISA (rev 08)
00:07.1 IDE interface: Intel Corporation 82371AB/EB/MB PIIX4 IDE (rev 01)
00:07.3 Bridge: Intel Corporation 82371AB/EB/MB PIIX4 ACPI (rev 08)
00:07.7 System peripheral: VMware Virtual Machine Communication Interface (rev 10)
00:0f.0 VGA compatible controller: VMware SVGA II Adapter
00:10.0 SCSI storage controller: LSI Logic / Symbios Logic 53c1030 PCI-X Fusion-MPT Dual Ultra320 SCSI (rev 01)
00:11.0 PCI bridge: VMware PCI bridge (rev 02)
00:15.0 PCI bridge: VMware PCI Express Root Port (rev 01)
00:15.1 PCI bridge: VMware PCI Express Root Port (rev 01)
00:15.2 PCI bridge: VMware PCI Express Root Port (rev 01)
00:15.3 PCI bridge: VMware PCI Express Root Port (rev 01)
00:15.4 PCI bridge: VMware PCI Express Root Port (rev 01)
00:15.5 PCI bridge: VMware PCI Express Root Port (rev 01)
00:15.6 PCI bridge: VMware PCI Express Root Port (rev 01)
00:15.7 PCI bridge: VMware PCI Express Root Port (rev 01)
00:16.0 PCI bridge: VMware PCI Express Root Port (rev 01)
00:16.1 PCI bridge: VMware PCI Express Root Port (rev 01)
00:16.2 PCI bridge: VMware PCI Express Root Port (rev 01)
00:16.3 PCI bridge: VMware PCI Express Root Port (rev 01)
00:16.4 PCI bridge: VMware PCI Express Root Port (rev 01)
00:16.5 PCI bridge: VMware PCI Express Root Port (rev 01)
00:16.6 PCI bridge: VMware PCI Express Root Port (rev 01)
00:16.7 PCI bridge: VMware PCI Express Root Port (rev 01)
00:17.0 PCI bridge: VMware PCI Express Root Port (rev 01)
00:17.1 PCI bridge: VMware PCI Express Root Port (rev 01)
00:17.2 PCI bridge: VMware PCI Express Root Port (rev 01)
00:17.3 PCI bridge: VMware PCI Express Root Port (rev 01)
00:17.4 PCI bridge: VMware PCI Express Root Port (rev 01)
00:17.5 PCI bridge: VMware PCI Express Root Port (rev 01)
00:17.6 PCI bridge: VMware PCI Express Root Port (rev 01)
00:17.7 PCI bridge: VMware PCI Express Root Port (rev 01)
00:18.0 PCI bridge: VMware PCI Express Root Port (rev 01)
00:18.1 PCI bridge: VMware PCI Express Root Port (rev 01)
00:18.2 PCI bridge: VMware PCI Express Root Port (rev 01)
00:18.3 PCI bridge: VMware PCI Express Root Port (rev 01)
00:18.4 PCI bridge: VMware PCI Express Root Port (rev 01)
00:18.5 PCI bridge: VMware PCI Express Root Port (rev 01)
00:18.6 PCI bridge: VMware PCI Express Root Port (rev 01)
00:18.7 PCI bridge: VMware PCI Express Root Port (rev 01)
02:00.0 USB Controller: Intel Corporation 82371AB/EB/MB PIIX4 USB
02:01.0 Ethernet controller: Advanced Micro Devices [AMD] 79c970 [PCnet32 LANCE] (rev 10)
02:02.0 Multimedia audio controller: Ensoniq ES1371 [AudioPCI-97] (rev 02)
02:03.0 USB Controller: VMware USB2 EHCI Controller
Depending on the hardware setup you could also have a gigabit ethernet controller:02:01.0 Ethernet controller: Intel Corporation 82545EM Gigabit Ethernet Controller (Copper) (rev 01)
Note: I don't use a SCSI disk as VMware Workstation recommends, instead I'm using a "normal" ATA disk wich works very reliable.3. Kernel setup
See http://www.gentoo-wiki.info/HOWTO_Install_Gentoo_on_VMware as a good base for a kernel config. You may have a look at this config file from the kernel gentoo-sources-2.6.32-r7.4. Gentoo and tools setup
My /etc/make.config is this - but note that I can also use the VM to generate an ISO and boot directly from it, so this is not a pure VM setup:ACCEPT_KEYWORDS="~x86"
CHOST="i686-pc-linux-gnu"
CFLAGS="-Os -mtune=pentium2 -pipe"
USE="-64bit -zeroconf xinetd cairo svg mmx sse sse2 hal X acpi -kde -gnome symlink -cups -ipv6"
INPUT_DEVICES="keyboard mouse vmmouse evdev"
VIDEO_CARDS="fbdev nv vesa vmware intel radeon"
LINGUAS="en de"
This make.config example is for a lightweight install with only few packages installed. Change it at will.Always a good practice is to install the open-vm-tools.
emerge -av open-vm-toolsDon't use the orginial VMware tools wich will be mounted automatically from the virtual CD drive: it fills your disk and simply doesn't work, because it lacks of recent kernel support. This step is optional, but it provides some good features like disk shrinking or time sync between host and guest. Start the service on every boot withrc-update add vmware-tools default5. HAL setup
Copy over the HAL policies from the /usr/share... folder:cd /etc/hal/fdi/policy
cp /usr/share/hal/fdi/policy/10osvendor/10-input-policy.fdi .
cp /usr/share/hal/fdi/policy/10osvendor/10-keymap.fdi .
cp /usr/share/hal/fdi/policy/10osvendor/10-x11-input.fdi .
cp /usr/share/hal/fdi/policy/20thirdparty/11-x11-vmmouse.fdi .
Don't forget to set your own keymap layout in 10-keymap.fdi and set the tag "input.xkb.layout" depending on your locale.The "vmmouse" driver is a bit more confortable than just "evdev" mouse driver - it's up to you to choose one.
6. Xorg setup
And now, lets talk about the Xorg server. Don't let him detect anything (X -configure) because you only get trash. Take this xorg.conf as a starting point and copy it to /etc/X11/xorg.conf:Section "ServerLayout"
Identifier "X.org Configured"
Screen 0 "Screen0" 0 0
EndSection
Section "Files"
ModulePath "/usr/lib/xorg/modules"
FontPath "/usr/share/fonts/misc/"
FontPath "/usr/share/fonts/TTF/"
FontPath "/usr/share/fonts/OTF"
FontPath "/usr/share/fonts/Type1/"
FontPath "/usr/share/fonts/100dpi/"
FontPath "/usr/share/fonts/75dpi/"
EndSection
Section "Module"
Load "glx"
Load "extmod"
Load "record"
Load "dri2"
Load "dbe"
Load "dri"
EndSection
Section "Monitor"
Identifier "Monitor0"
VendorName "VMware"
ModelName "VMWare virtual monitor"
HorizSync 1.0 - 10000.0
VertRefresh 1.0 - 10000.0
ModeLine "800x600" 100 800 900 1000 1100 600 700 800 900
ModeLine "1024x768" 100 1024 1100 1200 1300 768 800 900 1000
ModeLine "1152x864" 100 1152 1200 1300 1400 864 900 1000 1100
ModeLine "1280x768" 100 1280 1300 1400 1500 768 800 900 1000
ModeLine "1280x800" 100 1280 1300 1400 1500 800 900 1000 1100
ModeLine "1280x960" 100 1280 1300 1400 1500 960 1000 1100 1200
ModeLine "1280x1024" 100 1280 1300 1400 1500 1024 1100 1200 1300
ModeLine "1366x768" 100 1366 1400 1500 1600 768 800 900 1000
ModeLine "1440x900" 100 1440 1500 1600 1700 900 1000 1100 1200
ModeLine "1600x1200" 100 1600 1700 1800 1900 1200 1300 1400 1500
ModeLine "1680x1050" 100 1680 1700 1800 1900 1050 1100 1200 1300
ModeLine "1920x1080" 100 1920 2000 2100 2200 1080 1100 1200 1300
ModeLine "1920x1200" 100 1920 2000 2100 2200 1200 1300 1400 1500
EndSection
Section "Device"
### Available Driver options are:-
### Values: <i>: integer, <f>: float, <bool>: "True"/"False",
### <string>: "String", <freq>: "<f> Hz/kHz/MHz"
### [arg]: arg optional
#Option "HWcursor" # [<bool>]
#Option "Xinerama" # [<bool>]
#Option "StaticXinerama" # <str>
Identifier "Card0"
Driver "vmware"
VendorName "VMware Inc"
BoardName "Abstract SVGA II Adapter"
BusID "PCI:0:15:0"
EndSection
Section "Screen"
Identifier "Screen0"
Device "Card0"
Monitor "Monitor0"
SubSection "Display"
Viewport 0 0
Depth 24
Modes "800x600" "1024x768" "1152x864" "1280x768" "1280x800" "1280x960" "1280x1024" "1366x768" "1440x900" "1600x1200" "1680x1050" "1920x1080" "1920x1200"
EndSubSection
EndSection
Remove the ModeLines and the Modes you don't need. The ModeLine are calculated with a bash shell script; call it modelines.sh:#!/bin/bash
# Calculates VMware xorg.conf ModeLines
function write_modeline() {
W=$1
H=$2
A=$(( $(($W/100 + 1)) * 100 ))
B=$(( $(($W/100 + 2)) * 100 ))
C=$(( $(($W/100 + 3)) * 100 ))
X=$(( $(($H/100 + 1)) * 100 ))
Y=$(( $(($H/100 + 2)) * 100 ))
Z=$(( $(($H/100 + 3)) * 100 ))
echo ModeLine '"'${W}x${H}'"' 100 $W $A $B $C $H $X $Y $Z
}
params=$# # Number of command-line parameters
param=1 # Start at first command-line param
while [ "$param" -le "$params" ]
do
valuepar="echo \$$param"
value=`eval $valuepar`
W=${value%%x*}
H=${value#*x}
write_modeline ${W} ${H}
(( param ++ ))
done
Example call of this script:> ./modelines.sh 1024x768 1280x1024
ModeLine "1024x768" 100 1024 1100 1200 1300 768 800 900 1000
ModeLine "1280x1024" 100 1280 1300 1400 1500 1024 1100 1200 1300
7. VMware user agent
Once, you have the desktop up and running, it's important that you also run the open-vm-tools user agent. You may do this with following autostart file in ~/.config/autostart/open-vm-tools.desktop:[Desktop Entry]
Encoding=UTF-8
Type=Application
Exec=vmware-user
Name=VMware User Agent
Are there any failures on these settings? Or do you have some important informations for installing a VM? Please share it and post a comment below or send me an email.