Virtualizing some XP machines on Ubuntu - Page 1
Forum section: electronics / general

author: edy
author_rank: Super Contributor
timestamp: November 30, 2017, 04:25:46 pm
content: Hi everyone,I have a number of legacy Win XP machines running legacy client software that accesses a Windows Server. The legacy XP software also opens up some local Win apps for mail-merging purposes (such as MS Word).I would really like to virtualize the entire XP machine and have it run in a Virtual Machine on Ubuntu. For one, it will make backups easier as I would backup the entire image always. Second, it may make the WinXP machines less prone to attack or compromise. Even if compromised, I would hopefully be able to easily restore them. Also, if the machines die I don't want to rebuild the entire system from scratch and try to reinstall everything.So I'm stuck at a few basic steps. For one, I need to be able to make an "image" of the entire HD... operating system, all software, everything... like a Clone copy. I'm not sure what best software to do that with, and whether I should be booting the actual XP machine or removing the hard drive or booting from an Ubuntu OS (on a DVD or USB key) and cloning it (and with what software) that way. It makes sense to me that the machine shouldn't be booting off the drive you are wanting to clone so it doesn't lock up any files you want to copy.Second, once the image is made, I will need to try and set up and run a Virtual Machine on Ubuntu. What is a free good working option? I would want to test it out on my laptop and see if the image runs and boots and I will hook my laptop up to the network and see if the software talks to the Windows Server as it should, and if the proper apps get invoked (like mail-merge) in the virtual XP machine and that everything runs as it should.Finally, when I upgrade my hardware in the office or if I decide to migrate over, I will be reformatting all machines to Ubuntu OS and installing the virtual machine images and then can build copies of client machines very easily and deploy them this way.Any help would be greatly appreciated. I know it probably sounds easy to those of you who have done this already, but this will be my first time trying to clone a machine and virtualizing it. I want to make sure I can do it properly and have enough storage to do so and that I'm doing it the proper way. Thank you!

author: kulla
author_rank: Unknown
timestamp: November 30, 2017, 05:32:21 pm
content: Well you have few possible scenarios that you can try.Vmware has Vmware converter which is used to convert physical to virtual machine to be used on for example ESXi or Workstations, I did conversion from physical to virtual on ESXi and it went without too much hassle.Other solution would be to use some imaging backup software to create full image from physical machine and try to restore it to virtual one. I used Acronis Workstation with universal recovery for this.Good thing is that you are using XP so in case of any problems they should be easily solvable. XP is very forgiving when booting without drivers and stuff.

author: edy
author_rank: Super Contributor
timestamp: November 30, 2017, 05:42:31 pm
content: I like the idea of making a full HD image of the partition, complete with boot sector and all files, and storing it as a single image file that I can throw at the virtual machine. If possible, I would like to use freely available software to do this. Is there an Ubuntu tool available or am I using Windows software to make the image? If I can get a full HD image, then I can copy it over to my laptop and then try to get it to boot in a virtual machine.I will look into the VMWare option and Acronis software. I have Macrium Reflect Free sitting here on my WinXP machine but have not used it. I wonder if I can use that on the actual machine I am trying to clone and whether it will make a complete full copy to an external hard drive image file that can be used to mount into a VM. I assume it will be an ISO file or IMG file?I will read and try this and see how it goes as well:https://kb.vmware.com/s/article/1018406Looks like I'm going to download and try to do it with this:https://my.vmware.com/web/vmware/evalcenter?p=converter

author: daybyter
author_rank: Frequent Contributor
timestamp: November 30, 2017, 07:37:32 pm
content: I use VirtualBox on my Linux machine.

author: abraxa
author_rank: Frequent Contributor
timestamp: November 30, 2017, 07:53:56 pm
content: Quote from: edy on November 30, 2017, 04:25:46 pmCertainly possible.QuoteThere are three easy ways to do it: 1) hook up the drive over SATA directly; 2) hook up the drive over a USB->SATA bridge; 3) leave the drive in the original computer and boot linux from a USB stick, then copy via (gigabit) ethernet.There isn't any special software you need, dd does just fine, e.g. "dd if=/dev/sda of=/home/user/windows_harddrive.raw bs=8M".QuoteEasily done with VitualBox, which is what I use and would recommend:https://blog.sleeplessbeastie.eu/2012/04/29/virtualbox-convert-raw-image-to-vdi-and-otherwise/After converting the .raw to .vdi, you can simply add it as a host drive to a newly created empty virtual machine (use the GUI). Windows should boot right up.

author: edy
author_rank: Super Contributor
timestamp: November 30, 2017, 08:04:16 pm
content: Is there any advantage/disadvantage using VirtualBox vs. VMWare or some other VM software? Can the disc image I need to grab the same, and can I run it through either one and see if they work ok, or even alternate "playing" the VM image between them and just pick up where I left off with no issues? I need the VM to have network access so the software can access the shared Windows Drive on the Windows Server, that's the only issue. Hopefully when it boots it will detect it and map it appropriately just like a native boot into the OS.I figured out the HD on the WinXP machine is about 465 GB, but only about 145 GB is used. I would ideally like to grab 200 GB images so there is a little space in there but I could probably trim it down even more if I remove unneeded software or media files... maybe the core client and utilities can run on as little as 100 GB. I assume there is a way to trim these image files after?@abraxa....Thanks, I would probably link up the drive to an Ubuntu machine as a secondary drive. Then I assume I could mount it and use the "dd" util to copy it to a file on the host machine and can test out the image in VirtualBox. If that works, I can unplug the secondary drive with WinXP and put it back in the original machine.

author: abraxa
author_rank: Frequent Contributor
timestamp: November 30, 2017, 09:09:09 pm
content: Quote from: edy on November 30, 2017, 08:04:16 pmVMWare is commercial and closed source, VirtualBox is free for personal use and open source. Their image formats are incompatible as far as I know but honestly, I don't see why anyone would want to use VMWare. Networking works well on both, so no issue there, though you may need to adjust the networking settings of the virtual machine to make it work "properly" - i.e. having the Windows inside the VM obtain its own IP address by means of bridging.QuoteYeah, seehttps://superuser.com/questions/529149/how-to-compact-virtualboxs-vdi-file-sizeQuoteSure but there's no need to mount it - in fact, doing so could corrupt the data if it's mounted in read/write mode. With dd, you're accessing the hardware device directly - it doesn't care about what the data is that it's copying. By the way, make sure you don't omit the "bs=8M" parameter - otherwise, dd will be quite slow because it will only use 512 bytes as a buffer instead of 8 megabytes.

author: shteii01
author_rank: Frequent Contributor
timestamp: December 01, 2017, 02:06:54 am
content: I have used Clonezilla before. Used Live CD/USB to boot it and clone the hd (source) to another hd (destination). The problem I ran into was that destination partition needs to be same size as the source partition, I don't think this is a problem for you.It makes images too. And it is Linux based. Get you into the spirit of things to come.http://clonezilla.org/clonezilla-live.php

author: amyk
author_rank: Super Contributor
timestamp: December 01, 2017, 03:01:11 am
content: Quote from: abraxa on November 30, 2017, 09:09:09 pmVirtualBox can handle VMware's virtual disk format (VMDK), but not vice-versa.All virtualisation software can handle a raw disk image format. It's the "sparse"/"growable"/"flexible"/etc. formats that differ. The last time I checked, VMware even has the official spec for VMDK available publicly, so when I had to do some VM-related things I chose that format.

author: gnif
author_rank: Unknown
timestamp: December 01, 2017, 03:44:46 am
content: Don't forget about Qemu with KVM (libvirt), IMO it is a much better solution then VirtualBox.

author: edy
author_rank: Super Contributor
timestamp: December 01, 2017, 05:37:26 am
content: OK I've made some progress! Thanks for all the help and advice!First, I just wanted to see if I could get WinXP running (without even cloning any drives at the moment) and have it access network and work. So I followed the instructions here which explain how to download WinXPMode and install it under VirtualBox:http://www.makeuseof.com/tag/download-windows-xp-for-free-and-legally-straight-from-microsoft-si/The thing is, the link they provided on the above page for Microsoft's Download page was broken. Either Microsoft is no longer providing WinXPMode or it is found somewhere else. Either way, I was able to track it down on another site and hopefully was not virus-ridden:https://windows-xp-mode.en.softonic.com/By the way, I'm doing everything on Ubuntu Studio. I already have VirtualBox installed on my machine from before. So I followed the instructions on the first link which basically extracts the "xpm" file from the above downloaded file "WindowsXPMode_en-us.exe". The way in Ubuntu was:1. right click on "WindowsXPMode_en-us.exe" and choose Open with Archive Manager...2. double clicked on subfolder "sources" in the root dir3. found the file "xpm" in the sources dir of 496.2MB and extracted thatThe "xpm" file when extracted turned out to be a CAB file. So same thing again... right-clicked to Open with Archive Manager.... and found the file "VirtualXPVHD" in there and extracted it. Then renamed it by putting "." to make the extension VHD (so named "VirtualXP.VHD").At that point, was able to set up a VirtualBox machine as instructed on the above page. They recommended:1. Base memory 2048mb2. change boot order to HD3. increase display video memory to 128mb4. network... set it to "bridged adapter" and it picked up my WiFi on my laptop "wlp2so" (under advanced I picked "cable connected" and left others as defaultsSo I was able to boot up WinXP! Now there are a couple issues... One is it started asking me to do product activation. Therefore I had an old laptop sitting around with a Product Key sticker on the bottom for WinXP Pro and I used "activate by telephone" and then changed the product key when it asked for the ID code. Then I backed out of the telephone activation screen and decided to activate by Internet and it activated!WinXP also complains on boot-up of needing to update 2 drivers which I cannot get rid of.... something about "Basic System" and "Video Card". I just ignore them and go on. I guess if I am not rebooting the machine too often and just save the state, it won't really bother me.Next thing I did was go to "oldversion.com" and download the last known Google Chrome that works on XP (I picked up version 46), because the Internet Explorer that comes with WinXPMode is crap! I had a ton of trouble using IE just to load that site... the IE that comes with it is version 6.0, from 2004! Actually, I downloaded Chrome 17 first... just to get something running... and then used Chrome 17 browsing to "oldversion.com" to grab Chrome 46.... Which I then installed, and so far everything working fine!!! I browsed over to YouTube and was able to see some videos with sound and everything and smooth as silk!As Dave would say.... WINNER WINNER CHICKEN DINNER!A few oddities... like I can't set my WinXP to an HD resolution... it is standard 4:3 ratio type screen... like 800x600, 1024x748, etc. But my laptop is WIDE-SCREEN. I need to figure out where the settings are for that. [EDIT: I think I found it under Display for one of the tabs].So my first excursion so far into VirtualBox and WinXP has been pretty good! I'm excited to see where I go with the cloning/migration of my office machines. There are a few concerns... For example, will my cloned images try to make me "reactivate Windows" when they are running in VirtualBox because they detect significant hardware changes??? And if I do reactivate (I have Product Keys for everything) then what happens to the original machine? Will it know there is another cloned copy running and refuse to run or inactivate? Does WinXP reach out to Microsoft servers and check the activation keys to make sure there are no more than 1 instance of it running at the same time?I've attached a screen-shot.

author: edy
author_rank: Super Contributor
timestamp: December 01, 2017, 06:40:23 am
content: Ok, I figured out the screen resolution stuff... Turns out I have to install "Guest Additions" found under the VirtualBox machine's Device menu. It will download an ISO and "mount" it to WindowsXP which adds some video drivers and other stuff, and then that activates the "View" menu options that will allow me to change resolution to match my screen (1366x768). Now I have full-screen support for WinXP and it is running awesome!

author: abraxa
author_rank: Frequent Contributor
timestamp: December 01, 2017, 07:19:07 am
content: Great! Looks like you figured quite a lot out by yourself alreadyQuoteThe reactivation didn't happen to me. Most of my VMs have been installed in a VM from the get-go, though, and I'm running copies of the same installation for different purposes (but not at the same time). Activation was never an issue. Keep in mind that Windows is Microsoft's vehicle to lock users into their platform - it's not required to make money. They want it to spread, which is even more evident if you look at how they handle Windows 10.

author: edy
author_rank: Super Contributor
timestamp: December 01, 2017, 03:31:26 pm
content: So I think what I will need to do first to prepare the machines to clone is to first chop up the drive into partitions that make more sense. I mentioned that the XP machines have ~500 GB drives in them, but only maybe 150 GB is used, and of that, probably 70-80 GB are media files that do NOT have to be on the actual WinXP machine. Those media files can be in an Ubuntu folder and just mounted to WinXP as an extra drive. In fact, WinXP doesn't need them at all... I can just play them directly from Ubuntu as they serve no purpose within WinXP itself.Therefore, I may try first to just run some Partition Manager and see if I can break up my media and necessary WinXP folder and make 2 partitions... one "SYSTEM" partition that has the boot and core OS and applications, and another partition "DATA" that I can chuck everything else on. Then when I decide to "clone" the WinXP machine I will only choose the SYSTEM partition to clone (I assume this is allowed) and my Virtual Machine file that I end up with will be much smaller? Also, I am sure I can find a WinXP-compatible partition manager that will probably let me do that without killing the system, or I can boot from a Linux Live CD and it should let me shrink partitions without destroying stuff. Does that make sense?

author: edy
author_rank: Super Contributor
timestamp: December 04, 2017, 07:00:21 pm
content: I'm still working on "tidying up" my WinXP machine to prepare it for making a drive image.Meanwhile, I had a go at trying macOS and managed to download a few pre-made VMDK's for 10.12 Sierra and 10.13 High Sierra. Aside from some major sound issues and problems displaying fast graphics (or some graphics don't display at all like in the Map app), it works fairly well.... Although I am getting major frustration having it let me login with my iCloud/Apple ID accounts. Some features let me sign in, others don't, it's sporadic. One solution was to change the SERIAL of my VM using a special VirtualBox modify command to set the serial number of the machine to some real Mac out there. It solved a few AppStore login/download issues but others remain.Anyways, that was my side-tracking with VirtualBox but really I need to get back to the task at hand and get my WinXP virtualized on my laptop and see what happens when I plug it into my local network! I need it to be able to connect to all the Shared Windows Server directories, pick up Active Directory, login to the domain and recognize the printers (IP network printers), etc... There is a lot of stuff that has to work and that I am not at all sure about yet!

author: jmelson
author_rank: Super Contributor
timestamp: December 05, 2017, 03:20:33 am
content: Quote from: daybyter on November 30, 2017, 07:37:32 pmVMWare's tech support is absolutely the worst I have ever encountered -- I ended up telling THEM how to fix a simple problem, once.Also, they make you PAY for the newer version before they will give you "free" tech support.So, I went with VirtualBox, and it works VERY well. VMWare keeps separate state of the caps lock key on each VM, VirtualBox just has one state for the host and all VMs. (Micro complaint.) VMWare also handles virtual connection to the physical parallel port better. Other than that, VirtualBox has worked very well.I have to admit I do NOT run server applications on the XP VMs, only legacy CAD applications.Jon

author: edy
author_rank: Super Contributor
timestamp: December 05, 2017, 05:07:18 am
content: I have limited experience with VMWare. I used it several years ago to run a BlackBerry OS 10 environment to test out apps I was developing. I just followed the instructions from BlackBerry Developer pages, installed VMWare on a Windows XP system, loaded up the pre-configured VM file provided by BlackBerry and that's it. To test my apps, I would install it to the IP address of the VM which is how BlackBerry allows installation of apps. You basically set the phone in developer mode, and you use command-line utilities to send the app to the IP of the phone and it installs it once it verifies that the app has been signed by developer keys.Other than that, I have not really used VMWare for anything else. Then I started to abandon Windows and ended up in Ubuntu and have now everything I do is on Ubuntu at home. Except I am still using WinXP at the office and only because of some legacy software that is already set up on WinXP (and which I don't want to mess up), I have no interest in Windows anymore. I want to Virtualize my office WinXP machines and see if I can just have them run in VirtualBox because the day will come when the machines will die and I would prefer to have some VM's already pre-configured and waiting to resume the task. The machines are just running client software that accesses a server so there is nothing saved/stored on the WinXP client machines. If I have VM's then I can just bring the client computers back to life at a moment's notice running the legacy WinXP client software and that's it.While I am working on getting that done, I've been playing also with macOS running in a VirtualBox on my ASUS laptop (running Ubuntu Studio). The message I am typing now is using Safari on macOS High Sierra! I have access to the AppStore and various other components, but a few glitches I've noticed with audio/video. Otherwise, it is pretty much functional... the WhatsApp desktop app works fine, as does GIMP which I installed (although it took a while to load). I've attached a screen-shot, also taken within the macOS using the SHIFT-CONTROL-3 key combo (which is the iMac way to take full screenshots). By the way, on a Windows machine we don't have CONTROL key so instead it turns out that SHIFT-WINDOWSLOGO-3 does the same thing!I'm quite impressed that this is even possible. You can see in the screen-shot the AppStore open and I have been able to download a bunch of apps. The secret is to set up a serial number for the computer because VirtualBox otherwise defaults it to "0". I believe some apps draw to the screen perhaps with some direct-video technique and appear blank (like Maps and some Photo editors), but GIMP worked fine and is powerful enough for me. Video plays fairly quickly, yet the audio lags and skips. Games (like Lep's World) are a bit on the slow side... about 50% speed on my machine... anything more complicated (I tried a 3D air combat simulator) are unplayable. But for office apps it seems to work, they don't have the same graphics-intense requirements.It just blows my mind that I can run Ubuntu, Windows, macOS all at the same time on my computer and flip between them.

author: BradC
author_rank: Super Contributor
timestamp: December 05, 2017, 05:42:16 am
content: Quote from: edy on December 05, 2017, 05:07:18 amWe used to do that with Windows 95 & OS7.I currently run quite a few XP Machines under QEMU/KVM. In fact, I run quite a few windows variants to support legacy stuff. I have one Win 7 machine that needs decent graphics performance and 2 heads, so I use Spice/QXL for that but for all of the others I just RDP directly into the VM. That way there is no need for any special drivers and it's dead easy to move the machine around if required, plus I get all the fruit that RDP provides (cut and paste, file transfer and so on).I maintain that unless you have specific bare metal requirements, Windows has always run better (faster and more stable) under a VM. These days with the VirtIO drivers, it's quicker again.QEMU/KVM also has a few advantages in that it's native to the kernel, requires very little external support and bugs get fixed quickly when reported. Libvirt makes it easier to manage, but you can just as easily spool up a VM or two from the command line or a bash file.

author: kulla
author_rank: Unknown
timestamp: December 05, 2017, 07:27:52 am
content: One of the best things that you could do is to create one image of XP and then run symlinked clones on it, that way you save place but still have different virtual machines for each purpose you need them.

author: nctnico
author_rank: Super Contributor
timestamp: December 05, 2017, 09:26:15 pm
content: Quote from: edy on December 05, 2017, 05:07:18 amWelcome to the club

author: Circlotron
author_rank: Super Contributor
timestamp: December 05, 2017, 10:56:27 pm
content: I have used XP in VirtualBox on Mint Mate for about 4 years. For about the first 3 years it ran fine then started to go a bit flaky. During XP boot it would stop and give the error message something like “use last good configuration”. Doing a system restore would help for that boot only. Reinstalled XP and it was okay for a while but went bad again. Eventually I enabled Intel Virtualization Technology in BIOS and it was all good. Don’t understand the big picture, it just worked.

author: macboy
author_rank: Super Contributor
timestamp: December 06, 2017, 06:12:30 pm
content: Quote from: edy on November 30, 2017, 04:25:46 pmHere's how I do that exact thing (under windows as a host, but linux should be essentially the same):Download and install VMWare workstation. It will work in a limited capacity without license. You can do essentially anything except run a VM (which you can do with VMWare Player anyway).Ensure the disk from the XP machine is physically installed in the host machine but NOT mounted in any way.Create a new VM for Win XP. Set memory and other things as desired. Indicate you will install the O/S later (but you won't). When it has created the VM, go into the VM folder and delete the virtual disk it created (any/all *.vmdk files), you don't need it.Now edit the VM. Add a disk, choose physical disk, entire disk (not partitions) and choose your old XP machine disk. Ensure that if the original machine used an IDE disk (or SATA in IDE mode), choose IDE virtual disk, if it was a SATA disk in AHCI mode, then choose SATA... this is important. Then exit Workstation without powering up the VM (Important!). This creates a vmdk file which contains no actual data, but points to the physical disk. Note the path to this new .vmdk file.Now you will create a virtual image of the physical disk by converting that vmdk file into a new one.Ensure you are using a terminal where you have read access to the physical disk (for Windows, open cmd window as Administrator, for Linux, use su or sudo as you prefer). Find vmware-vdiskmanager.exe in the VMWare binary path. Run this in the terminal to "convert" the new vmdk file to a new image. Use the expandable, spilt into 2 GB option. This will read the entire disk and store it, byte for byte, into a new .vmdk file (actually a series of < 2 GB files). Ensure you have enough free space.When done, once again edit the VM in VMWare workstation and set the hard drive to this vmdk. Then, create a snapshot. VMWare will create another set of (empty) vmdk files which will hold the delta to the original, and the original will never be modified (to allow rollback). Now you can open VMWare player and run the VM (you can't run VMs within Workstation without a license).XP is happiest with >=1 GB RAM and >=2 CPUs. When you boot, XP will of course need to install drivers for everything. This process is mostly painless for a cloned Windows 7 machine, but a little more trouble in XP. You'll need to deal with any fallout from that. If XP crashes during boot you may have selected the wrong type of disk (IDE/SATA). Once you have it working, take another snapshot as a baseline.There are tools to "help" do this but I find that this is not hard or time consuming, other than the disk copy operation, and I prefer full control.

author: edy
author_rank: Super Contributor
timestamp: December 18, 2017, 06:26:31 pm
content: I have another issue from a friend whose 4 year old 250 gb SSD died in an HP EliteBook 840 G1. Aside from the short life of the SSD (very disappointing), he will buy a new drive and then I will be installing and adding the OS's. I want to put in a clean install of Ubuntu... and he wants to still use Win10. So I could virtualize Windows 10 in VirtualBox, or install it natively and use a dual-boot configuration (probably a better choice) with Ubuntu. Any thoughts?I think it will be easier for him to manage running a dual-boot system. I don't know if he will know how to handle Ubuntu and then using VirtualBox to run Win10. Also, I'm sure there will be a hit on performance running Win10 in a VM. So having a dual-boot system gives him the option to still use Win10. He is mainly using the machine for browsing, media playback, office stuff... all of which he can do very nicely in Ubuntu, and pretty soon we may find he has no use for and never boots into Win10.Here is a simple question... on Ubuntu, if I want to create a Win10 bootable USB key to then install it to the machine first, I assume I should be downloading the Win10 ISO first from here:https://www.microsoft.com/en-ca/software-download/windows10ISOAnd then I found this blog page which explains how to install it to a USB on Linux using WoeUSB or WinUSB tools on Ubuntu:http://www.webupd8.org/2016/06/make-bootable-windows-10-usb-install.htmlI assume that will format and copy the ISO to the USB drive and make it bootable and allow a fresh install of Win10 to the machine. License keys needed of course? Stickers on the machine or will any older validation stickers work (Win7?)... because many of the computers now running Win10 were upgraded from earlier versions of Windows. Will those keys work?Once Win10 is installed, I can then boot from the Ubuntu USB key and have it change the partitions and install the dual-boot menu and set up the Ubuntu partition. Has anyone done this lately with Win10? Any issues activating Win10? Do older keys work, how do things go with the ISO from the above link?I found the following Microsoft article on the subject of key activation but I'm having trouble understanding what it all means:https://support.microsoft.com/en-us/help/12440/windows-10-activationAlso, the machine currently has a "Win8" sticker on it (no product key sticker though) so I assume it came with Win8 but there is no product key sticker anywhere, who knows what was on there and if it was ever even upgraded to Win10. That's why I'm confused as to how this activating will work. Obviously the original system did get a Windows license, and aside from a new hard drive, no other hardware changes are there. It should be entitled to a free Win10 upgrade. Would Microsoft recognize the machine (by some unique hardware-based serial identifier?) and activate it, once it recognizes the machine was previously activated somehow with Win8 on it?