VMware workstation for classroom assistants
From Wiki
Background
Our classroom assistants have a requirement for a shared workstation which will be used to manipulate word documents, technical drawings and other simple tasks. No documents will be stored on the workstation, so there is no requirement to for separate user accounts. Most users are very non-technical, 100% compatibility with Microsoft Office documents is required, so this means running Microsoft Windows.
The workstation is going to be shared by many users, some of whom may have removable media. However, the workstation is likely to be disconnected from the network periodically during which time it will not receive virus definition updates nor Windows updates. Microsoft Windows can not survive in this environment.
The Solution
Using VMware's snapshot capability, we will be able to restore Windows from a known good state. VMware workstation will run on Debian Linux, the host operating system will be running an SSH daemon so that we can get remote access to the machine and restore the VM even when Windows will not boot.
The VM is started automatically on boot, shutting down the VM triggers a shutdown of the underlying Debian OS. This happens more-or-less transparently to the user.
- Perform a standard install of Debian Stable, do not install any graphical window manager.
- Fetch the required packages:
# apt-get -y install x-window-server build-essential linux-headers-2.6-686 sudo
- Install VMware workstation.
- Create a user to run the VM, the non-root user you created when you installed Debian is fine.
- Log in as your non-root user, startx and from within the xterm that loads run vmware.
- Create the VM as normal, or copy your already created VM from elsewhere and load to to check everything is working.
- Close VMware and Stop the X server by typing exit in the xterm.
- We want to make sure that the VM starts when the host machine boots and the the host machine shuts down when the VM stops. This is accomplished like so:
- $ cp /etc/X11/xinit/xinitrc ~/.xinitrc
- $ vi ~/.xinitrc
#!/bin/bash # $Xorg: xinitrc.cpp,v 1.3 2000/08/17 19:54:30 cpqbld Exp $ # /etc/X11/xinit/xinitrc # # global xinitrc file, used by all X sessions started by xinit (startx) # invoke global X session script . /etc/X11/Xsession & /usr/bin/vmware -q -X /home/stocksy/vmware/Windows\ XP\ Professional/Windows\ XP\ Professional.vmx ; \ /usr/bin/sudo /sbin/shutdown -h now
- $ sudo vi /etc/init.d/xp-vm
#!/bin/sh # Where 'stocksy' is your non-root user su stocksy -l -c "startx" &
$ sudo ln -s /etc/init.d/xp-vm /etc/rc2.d/S98xp-vm $ sudo ln -s /etc/init.d/xp-vm /etc/rc3.d/S98xp-vm $ sudo ln -s /etc/init.d/xp-vm /etc/rc4.d/S98xp-vm $ sudo ln -s /etc/init.d/xp-vm /etc/rc5.d/S98xp-vm $ sudo dpkg-reconfigure x11-common
Allow anybody to start the X server.
