1 AUTHOR: Jaap Struyk <japie@deserver.nl>
5 LICENSE: VMWare beta EULA, provided in the package. (and the M$ license regarding the guest OS)
7 SYNOPSIS: Using VMWare player on a (H)LFS system.
9 DESCRIPTION: Using Windows XP Pro terminal server on a linux server without running X.
10 (X-windows is needed for installation of guest OS!!!)
12 SYSTEM: x86, 32bit, 2.6 kernel, Glibc-2.3.x.
16 * qemu-img (part of qemu)
17 --> http://fabrice.bellard.free.fr/qemu
19 * vmplayer (a free (but closed) player for vmware virtual machines)
20 --> http://www.vmware.com/products/player
22 * Xvfb (part of Xorg or Xfree86)
24 --> http://www.xfree86.org
26 * Windows XP Professional
27 --> http://www.microsoft.com
30 --> http://www.rdesktop.org
33 --> http://www.microsoft.com
53 Once in a while there still the need for access to an Windows system,
54 for testing a webpage in IE, running some special application, test something
55 or yust to enjoy the fun of screwing something up.
56 In the past there was a free version of vmware for personal use, but that changed
57 and since running bochs is somewhat cpu consuming thats no option for an
58 production enviroment.
59 Now there is a free vmware player (still closed source unfortunatly) wich can
60 play machines created by a (non free) vmware version, but it's not that hard
61 to create your own machine with a free tool and an text editor...
63 First we setup our vm on a machine with X, and later on we move it to a server
64 without X, so we can use it as terminal server.
70 We start with installing qemu, since we need qemu-img to create our virtual disk.
71 It's a prety big build, but we only need qemu-img, so you could only install that.
73 Next we install the vmware player with ./vmware-install.pl (after unpacking)
74 The installer will ask some questions, for me the defaults seemed fine.
75 The installer will start vmware-config.pl wich will configure the player's setup.
76 On networking answer yes (default), I answerd no to NAT and host-only.
77 Above is enough to use a private adress in your virtual machine.
79 On a HLFS machine we have to build kernel modules with: -no-pie -fno-stack-protector-all
80 Since vmware-config.pl doesn't accept those in CC env. we have to add them to the modules source.
82 tar -xvf /usr/lib/vmware/modules/source/vmmon.tar
84 Edit vmmon-only/Makefile.kernel and and change the line:
86 CC_OPTS += -DVMW_USING_KBUILD -DVMMON -DVMCORE
90 CC_OPTS += -DVMW_USING_KBUILD -DVMMON -DVMCORE -no-pie -fno-stack-protector-all
92 tar -cf vmmon.tar vmmon-only
93 mv vmmon.tar /usr/lib/vmware/modules/source/vmmon.tar
95 We do the same thing for the vmnet module:
97 tar -xvf /usr/lib/vmware/modules/source/vmnet.tar
99 Edit vmnet-only/Makefile.kernel and and change the line:
101 CC_OPTS += -DVMW_USING_KBUILD
105 CC_OPTS += -DVMW_USING_KBUILD -no-pie -fno-stack-protector-all
107 tar -cf vmnet.tar vmnet-only
108 mv vmnet.tar /usr/lib/vmware/modules/source/vmnet.tar
110 After that you can manualy run vmware-config.pl...
116 Create the virtual drive (guess what 2G means ;)
118 qemu-img create -f vmdk WindowsXP.vmdk 2G
120 Create the virtual machine config file WindowsXP.vmx
122 cat > WindowsXP.vmx << "EOF"
124 virtualHW.version = "3"
125 ide0:0.present = "TRUE"
126 ide0:0.filename = "WindowsXP.vmdk"
128 MemAllowAutoScaleDown = "FALSE"
129 ide1:0.present = "TRUE"
130 ide1:0.autodetect = "TRUE"
131 ide1:0.fileName = "auto detect"
132 ide1:0.deviceType = "cdrom-raw"
133 floppy0.present = "FALSE"
134 ethernet0.present = "TRUE"
135 usb.present = "FALSE"
136 sound.present = "FALSE"
137 displayName = "WindowsXP"
139 nvram = "WindowsXP.nvram"
142 ethernet0.addressType = "generated"
143 uuid.location = "56 4d 5c cc 3d 4a 43 29-55 89 5c 28 1e 7e 06 58"
144 uuid.bios = "56 4d 5c cc 3d 4a 43 29-55 89 5c 28 1e 7e 06 58"
145 uuid.action = "create"
146 ethernet0.generatedAddress = "00:0c:29:7e:06:58"
147 ethernet0.generatedAddressOffset = "0"
148 tools.syncTime = "TRUE"
149 ide1:0.startConnected = "TRUE"
150 checkpoint.vmState = "WindowsXP.vmss"
153 Create the vmplayer config file .vmware/preferences
155 cat > .vmware/preferences << "EOF"
156 pref.grabOnKeyPress = "FALSE"
157 pref.autoFitFullScreen = "fitHostToGuest"
158 pref.view.navBar.type = "favorites"
159 pref.mruDest0.present = "FALSE"
160 pref.mruDest0.destString = ""
161 pref.mruDest0.user = ""
162 pref.mruDest1.present = "FALSE"
163 pref.mruDest1.destString = ""
164 pref.mruDest1.user = ""
165 pref.mruDest2.present = "FALSE"
166 pref.mruDest2.destString = ""
167 pref.mruDest2.user = ""
168 pref.mruDest3.present = "FALSE"
169 pref.mruDest3.destString = ""
170 pref.mruDest3.user = ""
171 pref.mruDest4.present = "FALSE"
172 pref.mruDest4.destString = ""
173 pref.mruDest4.user = ""
174 pref.mruDest5.present = "FALSE"
175 pref.mruDest5.destString = ""
176 pref.mruDest5.user = ""
177 pref.mruDest6.present = "FALSE"
178 pref.mruDest6.destString = ""
179 pref.mruDest6.user = ""
180 pref.mruDest7.present = "FALSE"
181 pref.mruDest7.destString = ""
182 pref.mruDest7.user = ""
183 webUpdate.checkLast = "1130514727"
184 webUpdate.lastCheck.status = "err_connect"
185 pref.vmplayer.exit.vmAction = "poweroff"
186 pref.vmplayer.webUpdateOnStartup = "FALSE"
187 pref.vmplayer.deviceBarToplevel = "FALSE"
188 pref.vmplayer.showStatusBar = "FALSE"
190 hint.xinfo.noDGA = "FALSE"
191 hint.mks.noXKB = "FALSE"
192 gui.fullScreenResize = "FALSE"
193 hint.svgax.noDGAisXFree86 = "FALSE"
200 Start the player with
202 vmplayer WindowsXP.vmx
204 If you get a question on startup regarding an "identifyer", say always create one.
205 Now it's time to install Windows XP, with that your on your own, luckely no drivers needed.
206 Yust make sure you add your users, give them passwords and enable terminal services.
207 If all went well you have a shiny fresh XP. (personaly I gave a static IP, do what you want)
210 rdesktop -u $USER -p $PASSWORD -g 800x600 -a 16 $WINXP_IP_ADRESS
212 If all is working well it's time to move the setup to our server.
213 Off-course you can leave it at your workstation if you are happy so far.
219 Next we login to our server and create the vmware user
221 groupadd -g 66 vmware
222 useradd -c 'vmWare user' -d /srv/vmware -g vmware -s /bin/bash -u 66 vmware
224 mkdir /srv/vmware/.vmware
226 Copy all the needed files to the server
228 /srv/vmware/WindowsXP.vmdk
229 /srv/vmware/WindowsXP.vmx
230 /srv/vmware/.vmware/preferences
232 Install vmplayer on your server, same way as above.
234 Make sure you have Xvfb installed, if you came this far that won't be a problem.
238 chown -R vmware.vmware /srv/vmware
240 And fire up the thing
242 su - vmware -c "PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/X11R6/bin nice -n 10 Xvfb :1012 -screen 0 640x480x8 -fbdir /srv/vmware &"
243 su - vmware -c "PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/X11R6/bin DISPLAY=:1012 vmplayer '/srv/vmware/WindowsXP.vmx' &"
249 The identifyer thingy can be a problem, if a virtual machine is moved vmplayer will complain.
250 Since all interaction between vmplayer and the user is via X you will not know that.
251 Monitor your system with top, the vmplayer will consume a lot off cpu when Windows is starting,
252 if you don't see that there is a problem, check your syslog and the logfile in /srv/vmware
253 A workaround for this is to do the first start on your server via vnc, so you can watch vmplayer
254 starting, if that goes fine (without interaction) it will also work in Xvfb.
256 If you dislike the idea of bying a Windows XP Profesonal (Home edition doesn't have a remote desktop server)
257 Maybe you have a home edition (license) laying around (provided with your bought pc)
258 it is an option to upgrade your home to pro, it will save some bucks...
260 Another option is to buy an (old) Windows 2000 Advanced Server, if your lucky you can
261 get it cheap and it offers license for 5 clients, instead of the one XP-pro has.
262 Only have to change the line guestOS = "winXPPro" to guestOS = "win2000pro" in your vmx file.
263 (and to make it more pretty, I would change all XP names to 2K, but that's your choice ;)
269 http://www.lemoncube.com/104.html
270 http://johnbokma.com/mexit/2005/10/26/vmware-player-windows-xp.html
271 http://www.hackaday.com/entry/1234000153064739
277 * Added license and changelog entry.
278 * Added cat command for creation of config files.
279 * Added 2 sections to the notes regarding windows licenses.
281 * Added HLFS install instructions for vmware.
285 http://linuxfromscratch.org/mailman/listinfo/hints
286 FAQ: http://www.linuxfromscratch.org/faq/
287 Unsubscribe: See the above information page