As described in another post, I needed to set up a basic Windows XP virtual machine (VM) in Oracle VirtualBox, so as to have a place to use Cameyo. This post presents the steps I took to that end. A later post provides an overview of the steps discussed here.
Note: it seemed that, to get a clean machine, it might not be good enough to take an existing Windows XP installation or VM and uninstall programs from it. It might not be feasible to detect and uninstall all processes that had previously been set in motion. Moreover, uninstalling did not always remove all files associated with a program. It appeared that virtualizers like Cameyo might not register that a file was added, or needed, for a certain program, if that file was already present and thus was not a new addition that would be detected in the virtualizer’s before-and-after comparison of the system state.
Creating the Empty VM
I began with a search for sources of advice. WikiHow advised starting with a 32-bit WinXP ISO, extracted if necessary from a Windows XP installation CD. ImgBurn was convenient for creating that ISO: insert the CD into the computer and choose the “Create image file from disc” option. (Note that it was apparently possible to change the product key after installation, in case the CD or ISO did not match the user’s actual product key.) I used an updated, slipstreamed XP CD with service pack 3 (SP3) installed, as advised in Cameyo’s materials (see other post).
The first step, according to WikiHow, was to create the VM. For this, I used VirtualBox > Machine > New. Initially, I thought 2GB RAM would be good, but for some VMs (especially running on a Windows 7 system) this caused problems. I decided the better approach was to start with 500MB to 1GB and then expand later, which VirtualBox would freely allow. WikiHow told me to choose the “Create a virtual hard disk now” option (i.e., not “Use an existing virtual hard disk file”). In the ensuing steps, I went with the default VDI file type, and dynamically allocated storage. (Contra How-To Geek, it appeared that the performance drawbacks of a dynamic disk would not be noticeable on modern hardware. TechRepublic said that even the small difference would be substantially reduced if the VM was on an SSD.) I found, in practice, that the default 10GB disk size was too small for some applications; 20GB was better. I made sure to indicate where I wanted this VM to be created.
WikiHow didn’t say much about adjusting the VM’s settings. WikiHow was doing this in Ubuntu, anyway, not Windows, so I looked at other sources. Tom’s Hardware offered more information. To implement their suggestions (plus a few that I picked up in previous VirtualBox use), in VirtualBox I selected the new WinXP SP3 VM, clicked Settings, and made the following adjustments to the default values:
- General: Advanced tab: Put the Snapshot folder in the desired location. Set both Shared Clipboard and Drag’n’Drop to Bidirectional.
- System: Motherboard tab: Enable I/O APIC. Processor tab: I had an eight-core CPU. I felt I could spare two cores for this VM. I believed that having more than one core would help to eliminate performance bottlenecks.
- Display: Screen tab: I had a lot of video RAM, so I set the slider to the maximum 128MB. Enable 2D and 3D acceleration.
- Network: Adapter 1 tab: Bridged rather than NAT may be necessary for some, but was not necessary for me. (Later, I would disable this adapter, so as to avoid the risk of viruses, antivirus program activity, or other complications that Cameyo would have to capture.)
- Shared Folders: Click the blue plus folder icon at right. Navigate to the folder that will contain files to be swapped between the VM and the computer’s main (in my case, Windows 7) operating system. Make it a folder that will have no extraneous activity while Cameyo is running. Give that folder a name, and check Auto-mount. Click OK to close Settings.
I was concerned that some of these adjustments (notably acceleration, and the required I/O APIC) might not count as making a basic WinXP VM. That is, I was afraid of complicating the situation for Cameyo. But I was also a bit concerned about performance.
A Note About Account Names
Experience would soon teach me to use the same account name on all of my virtual and native computer installations. For me, that name was ray. I chose a lowercase name (i.e., not Ray) because that was what Linux used. Failure to do this could result in an error message, as I discovered when I attempted to run a Cameyo package that I had made on a different VM:
Microsoft Excel has not been installed for the current user. Please run setup to install the application.
It was important to have the account name sorted out from the beginning. Otherwise, the tweaks and fixes described in this post could all be made to the wrong account. If I had already created a system with the wrong account name, I could fix it (after creating the VM, but preferably before commencing the following tweaks) by going into Control Panel > User Accounts > Create a new account > create as Computer Administrator. Then I could delete other user accounts as needed. In the case of the built-in Administrator account, the only option was to disable it. This command provided a convenient way to do that:
net user administrator /active:no
That way, I would boot into the ray account, not into the Administrator account, and would thus not be at risk of spending an hour applying tweaks to the wrong account. To emphasize, this new account would be new: it would not have the adjustments that may have been applied to some other account.
If that didn’t work, there were alternatives. For one thing, it was possible to clone an existing account. Or to delete an administrator account other than the built-in administrator, the advice was to use Control Panel > Administrative Tools > Computer Management > Local Users and Groups > Users > right-click > Delete. To rename the built-in administrator, a search led to advice to use Control Panel > Administrative Tools > Local Security Policy > Local Policies > Security Options > right-click on Accounts: Rename Administrator Account > Properties > type desired name in place of Administrator. One time, for me, that resulted in a “system could not log you on” error, to which Microsoft’s advice was to change “Administrator” to the new user name in the registry at HKEY_LOCAL_MACHINESoftwareMicrosoftWindows NTCurrentVersionWinlogonDefaultUserName.
Installing Windows XP in the VM
Now, as How-To Geek and my other advisors suggested, I selected the WinXP SP3 VM and clicked Start. This gave me a “Select start-up disk” dialog. I clicked the folder icon to navigate to the ISO that I wanted to install and then clicked Start. This commenced the Windows XP setup process inside the VM. I hit Enter, when prompted, to start the WinXP setup, and continued following Microsoft’s installation instructions as provided in the VM. The installer detected only that 10GB virtual drive as a place to install, so I hit Enter to go ahead with that, and accepted the default NTFS formatting option. This gave me an error:
VirtualBox – Error
An error has occurred during virtual machine execution! The error details are shown below. You may try to correct the error and resume the virtual machine execution.
Unable to allocate and lock memory. The virtual machine will be paused. Please close applications to free up memory or close the VM.
Error ID: HostMemoryLow
Severity: Non-Fatal Error
My advisors did not anticipate this problem. A search led to a suggestion that I allocate no more than 300MB RAM to the VM. I assumed I could increase that value later, but I wasn’t sure that all of my programs would install in that little space.
As an alternative, watching my actual system usage in the Moo0 System Monitor, I tried killing Google Chrome in the main machine. That freed up a bunch of RAM. Then I clicked the X in the upper right corner of the WinXP SP3 VM window. That gave me an option to Save the machine state or Power off the machine. I chose Save. Back in VirtualBox, I clicked Start again. That continued the installation process. But then I got that error message again — even though Moo0 said I had almost 7GB RAM free.
I powered down the VM and changed its Settings > System > Motherboard tab > Base Memory to just 300MB. (It was possible to type that value directly into the box.) I clicked Start again, hit a key to boot from the CD (which was now only partly installed), and started over. This time, the installer showed me a WinXP installation. I hit Esc to reinstall from scratch, designated the newly created drive C as the target location, and once again requested NTFS formatting. I assumed that this formatting would wipe out any residual problems or errors that my previous aborted installation might have created.
That seemed to take care of it; I had no further memory error messages. The installation finished, and WinXP rebooted inside the VM. This time, I did not hit a key to start from CD; I just let it run, and WinXP came up and continued installing itself. Then it asked me the usual questions. Wherever possible, I went with the defaults. It rebooted. It asked if I could read the screen. The screen was completely black, so I opted out of that.
Tweaking the WinXP Installation
Now, it seemed, I had a working Windows XP VM. But we were still in need of some adjustment. Based on what I could see and on a previous post offering a more elaborate Windows XP installation, several issues confronted me:
- First, there were some settings that could only or best be changed by a registry edit. For that purpose, I pasted the following material into Start > Run > Notepad, saved it on the Desktop as WinXPRegEdits.reg, and then ran it by double-clicking on it. Its contents:
Windows Registry Editor Version 5.00 ; This is WinXPRegEdits.reg ; Disable Windows Tour [HKEY_CURRENT_USERSoftwareMicrosoftWindowsCurrentVersionAppletsTour] "RunCount"=dword:00000000 ; Set online registration as being completed [HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindows NTCurrentVersion] "RegDone"="1" ; Set Control Panel to classic view [HKEY_CURRENT_USERSoftwareMicrosoftWindowsCurrentVersionPoliciesExplorer] "ForceClassicControlPanel"=dword:00000001 ; Disable balloon tips [HKEY_CURRENT_USERSoftwareMicrosoftWindowsCurrentVersionExplorerAdvanced] "EnableBalloonTips"=dword:00000000
- To improve display resolution, I went into Start > Control Panel > Display > Settings tab > maximum available (1600 x 1200) > Apply > accept it if it looks OK. I dialed it back to 1024 x 768 so as to require a smaller window. While I was there, I went to Display > Screen Saver tab > Screen Saver: None. Also, Display > Desktop tab > Customize Desktop > uncheck “Run Desktop Cleanup Wizard every 60 days.”
- This Windows XP installation was not yet activated. My exploration of activation options culminated in the creation of a separate post to discuss that topic.
- Normally, at this point I would want to install antivirus software. But it seemed that antivirus software could interfere with Cameyo. So I went into Control Panel > Security Center and unchecked the alerts. Then I turned off the VM and went into VirtualBox > Settings > Network > uncheck Enable Network Adapter. Needless to say, I did not pursue Control Panel > Windows Update: as above, I did not want to risk viruses, not to mention the possibility that more recent Microsoft updates (beyond the SP3 already slipstreamed into this Windows XP installation CD) might actually impair system stability. Actually, I was not even sure how XP updates worked anymore, now that Microsoft was no longer supporting XP. Thus, I went into Control Panel > System > Automatic Updates tab > Turn off Automatic Updates.
- I wanted to increase RAM back to 2GB. For this, I went to Start > Turn Off Computer > Turn Off. Then, in VirtualBox, with this VM selected, I went to Settings > System > Motherboard tab. I restarted the VM. But no, it still didn’t work, even with 8GB of RAM free in the system. I tried again, this time setting it to 1GB. That worked.
- Using the VirtualBox menu at the top of the Windows screen, I selected Devices > Install Guest Additions CD Image. I went with the default values. I got a warning: “The software you are installing has not passed Windows Logo testing to verify its compatibility with Windows XP.” That message came up several times. Each time, I selected Continue Anyway. The installation completed and I opted for Reboot Now.
- After the VM rebooted, I went into Start > Run > msconfig > BOOT.INI tab > check /SAFEBOOT MINIMAL > OK > Restart. That started the VM in Safe Mode. Here, according to Tom’s Hardware but not PCWorld, I had to repeat the Guest Additions installation. (Later, I would conclude that this step was probably unnecessary.) Then, while I was still in Safe Mode, before accepting the offer to Reboot Now, I went back into msconfig > BOOT.INI tab > uncheck /SAFEBOOT > OK > Restart. Back in WinXP’s Normal Mode, now I had a little blue cube in the system tray, and when I moused over it, it said, “Oracle VM VirtualBox Guest Additions 5.0.16r105871.”
- When the VM started, I had to enter the Administrator password. I didn’t want to have to do that. A search led to advice to go into Start > Run > control userpasswords2 > uncheck “Users must enter a user name and password to use this computer” > OK > Leave password blank. But that didn’t solve the problem. Another suggestion: Control Panel > User Accounts > Pick an account to change > choose Administrator rather than Guest (there were only those two) > Remove my password. But there was no “Remove my password” option there. Instead, at that location, I chose Change My Password, entered the existing password, left the New Password and Confirm fields blank, and clicked Change Password. Also, I went into Control Panel > Power Options > uncheck “Prompt for password when computer resumes from standby.” While I was there, I also set the monitor and hard disks to never turn off.
- On the desktop, I went to Recycle Bin > right-click > Properties > uncheck “Display delete confirmation dialog.”
- I went into Start > My Computer > Folders button, so that I could see folders in the left pane of Windows Explorer. I verified that I could see and move files between the WinXP desktop and the shared folder on the main Windows 7 system. I selected View > Explorer Bar > Folders; also View > Arrange Icons By > uncheck Show in Groups; also Tools > Folder Options > View tab > Display the contents of system folders and also Restore previous folder windows at logon; then, in that same View tab, I clicked Apply to All Folders.
- It seemed Cameyo would be helped if I could minimize the numbers of programs and services running in the background. Start > Run > taskmgr > Processes tab indicated that, fortunately, few processes were running now. Start > Run > msconfig > Services tab said that VirtualBox Guest Additions was the only non-Microsoft service running. A search led to lists of services that could supposedly be disabled safely. A different search suggested that some such changes could induce WinXP system instability. I decided to postpone this step, maybe trying it later if Cameyo was having problems.
- As a final checkup, I went to Start > Run > “sfc /scannow.”
With those measures in place, I powered down the VM. Then I made backups in two ways. First, in VirtualBox, with this WinXP SP3 VM selected, I clicked the Snapshots in the upper right corner and then the blue snapshot icon on the right-side menu bar. Second, after shutting down VirtualBox itself, I went into Windows Explorer and created a zip file containing both the large (~1.7GB) WinXP SP3.vdi file (which held the Windows XP system files) and the WinXP SP3.vbox and .vbox-prev files. The latter were with the other VirtualBox program files, in a /data/.VirtualBox/Machines subfolder. With those steps in place, it seemed I had a complete basic Windows XP virtual machine.