Previous  1, 2, 3, 4
Virtualize Win7 setup from HDD to VirtualBox 
Author Message
User avatar

Joined: 2014-09-27 09:29
Posts: 2194
Location: Soviet Venezuela
 Re: Virtualize Win7 setup from HDD to VirtualBox
koimaxx wrote:
tomman wrote:
Define "portable".

Portable as in "can I easily move VMs between systems"? OVF works wonders for that.
Or portable as in "can I switch between virtualization solutions at will"? The latter is tough if your target solution doesn't support OVF (so that excludes QEMU and Hyper-V), and even if OVF is supported, there might be minor mismatches (I have never tried that). The sole case I've dealt with is my XP Mode VM: from Virtual PC to VMWare I used vCenter converter thing, and from VMWare to VBox, I just copied the VMDK and created a new VM. In both cases I just uninstalled the old integration tools, and installed the matching ones for the current solution. So far it has worked fine, but that VM is as barebones as it can be.

The former. I hadn't played around too deeply VirtualBox yet myself, but I had hoped that the option was available. Glad to hear there is an option. I don't think I'll be working with VMWare too much so converting between platforms is less of a concern for me at the moment.

Exporting VMs on VirtualBox to OVF is very easy: either you run a wizard (if using the GUI), or a single command (CLI). Importing them is exactly the same procedure. At most I've had to fix network settings if using bridged mode (for choosing the correct NIC which may be different between hosts), and you will want to use a SSD at all times since the time-consuming part is to deal with the virtual HDD image(s).

_________________
Licensed Pirate® since 2006


2017-04-22 19:51

Joined: 2014-09-27 09:44
Posts: 966
 Re: Virtualize Win7 setup from HDD to VirtualBox
In the end: the install doesn't complete, complaining about a missing file. Which means the image is most likely corrupted.
VirtualBox is getting out of my life, I will play Sakura Taisen on Dreamcast and Microsoft must die way more than Trump.

_________________
"Even if b became the most amazing programming language the world has ever seen, I would not rewrite higan/icarus in it. I can 100% guarantee you of that." — byuu


2017-04-22 20:55

Joined: 2014-09-27 09:44
Posts: 966
 Re: Virtualize Win7 setup from HDD to VirtualBox
To add insult to injury, and to quote byuu: "Fuck this."
I deleted all my PC Sakura Taisen archives: no CD, updates, everything that was pulled off the Internet.
One day of Windows and I am on the verge of real life murder.

_________________
"Even if b became the most amazing programming language the world has ever seen, I would not rewrite higan/icarus in it. I can 100% guarantee you of that." — byuu


2017-04-22 21:03
User avatar

Joined: 2014-09-27 09:29
Posts: 2194
Location: Soviet Venezuela
 Re: Virtualize Win7 setup from HDD to VirtualBox
Reminds me the time when I wanted to play Kagetsu Tohya (a Tsukihime fandisc), just to discover that my CD-R was missing the audio tracks because whatever image I had downloaded was corrupted. A bit that I ended discovering... like 4 years too late!

(Fortunately I ended tracking down a full, proper, untouched copy of the Tsuki-Bako edition, can't remember if it was on Underground-Gamer or Perfect Dark)

_________________
Licensed Pirate® since 2006


2017-04-22 21:18
User avatar

Joined: 2014-09-27 09:29
Posts: 2194
Location: Soviet Venezuela
 Re: Virtualize Win7 setup from HDD to VirtualBox
In this episode of "tomman's neverending misadventures on virtualization":

Yesterday one our customer server boxes came for servicing (mainly for installing updates, performing backups, checking that the Barracuda 7200.14 inside hasn't commited suicide yet, and other things they can't do because a: they have no IT dept, and b: they don't even have DSL on that remote town, only craptacular 3G). This ThinkServer TS140 came with a Windows Server 2012 R2 Standard license, yet the old version of $PRODUCT only works with the long deprecated SQL Server 2000*, which obviously isn't compatible with anything beyond WS2003. Well, actually you can force-install it and (surprisingly) it will run but the Enterprise Manager MMC applet will crash as soon as you try to open any table or view, rendering it kinda useless:
Image
Another fine TDWTF Frontpage Class A+ Material

So what you do when you need to manually fix some record at some table yet you can't remote into the server because you don't have a working XP machine with the SQL Server 2000 client tools installed? Well, that's why we got virtual machines!

I actually have a XP VM specially crafted for cases like this: it has a full XP+SQL2000 setup (sans the server components since client SKUs can only run MSDE), ready to deploy and enjoy. So far I've used it to virtualize older legacy installs of $PRODUCT (for which MSDE is more than enough, despite its 10-connection limit) while coexisting with the new Linux/J2EE-based setup. And all those deployments have had a single point in common: good ol' VirtualBox. But this time my target doesn't run Linux, and for making things more interesting, Hyper-V is already installed and that one doesn't really like playing along other hypervisors. Uninstalling it could be tricky, so I decided to go with it... after all, how difficult could be a VirtualBox->Hyper-V VM migration?

The answer: very painful.

You would be tempted to take your VM, export it as an .ova OVF appliance (supposedly that is an industry-standard format), and import it on the target... except that we're talking about Microsoft, where "interoperability" is not exactly on their dictionary. Yes, Hy-perv doesn't support .ova appliances (which are nothing but uncompressed .tar files containing some XML with the VM setting and a VHD image). My only option is to copy the VHD image to the target and attach it to a new VM. And there comes the second hurdle: VirtualBox uses VMDK, Hyper-V uses VHD, and since WS2012 they switched to VHDX. But don't fret - QEMU got our colelctive asses covered there:
Code:
qemu-img convert -f vmdk XP.vmdk -O vhdx -o subformat=dynamic XP.vhdx

There is even a native Win64 binary for those not in Linux

With that hurdle sorted, we can simply attach the VHD to our new XP VM, boot it, install some drivers and call it a day, right?
NO!
Just try it: boot your new VHD... just to stare at a logon screen where you can't interact with it at all because neither keyboard nor mouse are working!
While Hyper-V does emulate prehistoric PS/2 KB+MS, Windows gets confused because it's being booted in a different hardware and tries to install the matching drivers, and for that it has to display some UI... and it can't do that at a logon display. Oops.

Back to VB, enable autologon on the VM, export it again, spend next 30 minutes moving 48GB between hosts, convert the VHD again, attach, boot, now it can show some "New Hardware Found" displays. Yet still, no KB+MS working. ARGH! Even worse: MS will want to ask for your permission to install some of the special drivers it finds, and since no input device is working at this stage, you will get stuck with a nice Catch-22.
Image
Failure: it's what's for lunch
While F8 works for entering the boot menu and enabling Safe Mode, even there KB+MS won't work AT ALL. Fuck.

Some may suggest preinstalling the Integration Services prior to moving the VM. But the installer won't run under non-Hyper-V hypervisors (duh!). Fine, there is a .msi package, let's try installing that. It does seem to preinstall some drivers. Spend 30 minutes shuffling the VHD around, try to boot it again... and... get stuck again at a "Do you want to look for drivers at Windows Update" dialog. FUCK.

There should be a way to get rid of this dialog...
Code:
REGEDIT4

[HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\DriverSearching]
"DontSearchWindowsUpdate"=dword:00000001
"DontPromptForWindowsUpdate"=dword:00000001
"DontSearchCD"=dword:00000001
"DontSearchFloppies"=dword:00000001

[HKEY_CURRENT_USER\Software\Policies\Microsoft\Windows NT\Driver Signing]
"BehaviorOnFailedVerify"=dword:00000000

[HKEY_USERS\.DEFAULT\Software\Policies\Microsoft\Windows NT\Driver Signing]
"BehaviorOnFailedVerify"=dword:00000000

Let's export the VM again, boot... marginal improvement. Still no KB+MS. But this time I don't get prompted to connect to the Internet!

Is there a way to get rid of that idiotic wizard and just let Windows install the drivers it already knows? Well, there is this:
Code:
REGEDIT4

[HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows\DeviceInstall\Settings]
"SuppressNewHWUI​"=dword:00000001

Another 30-minute cycle again... the VM sat there doing NOTHING. Apparently this not only disables the wizard, it even disables driver autoinstall! FUCK FUCK FUCKITY FUCK!

And I lost a complete day there, thanks to Hy-perv.

Today I decided to rollback that last change and give it another try to the driver install UI. Who knows, at some point it HAS to detect the keyboard...
The problem? As soon as it gets stuck at the first wizard, Windows doesn't seem to commit the changes to the registry, and no driver gets installed, so no matter how many times you reset the VM, the keyboard driver has a fat chance in hell to get picked up.

Then, I decided to try something silly. At some point I had noticed that Windows detected the virtual DVD drive, and when it got stuck at one of the wizards, I inserted the Integration Services disc image. Surprise, it "unstuck" one of the wizards! ...halfway. Now it was getting stuck at "press Finish and reboot to continue", but this time I noticed that whatever got installed stuck this time. After a couple reboots and "fool the wizard with a useless CD", keyboard started working! Yay~! But whenever I clicked on the VM window, Hy-perv complained that the Integration Services weren't working and hence I had no right to a mouse. "But wait, didn't I had preinstalled the drivers?" Well, not exactly: since they weren't installed The Proper Way™, the drivers refused to start, and when I eventually managed to fire up Device Manager, everything named "Microsoft Hyper-V <something>" was flagged with warning symbols.

At some point, the driver install ended and mouse started working... poorly. Uninstalled VirtualBox addons, uninstalled the Hyper-V integration services, installed them again. Wait,
are you asking me to change my HAL!? ...sure, why not? And a couple reboots later:
Image
Achievement Unlocked: PCI Mass Abuse

...and it only took me two work days because fuck Microsoft and FUCK HY-PERV!.
(And I'm not mentioning side WTFs like the entire VM getting trashed because I decided to change the synthetic NIC settings or whatever)

I didn't had to experience such pains when I moved my XP Mode VM between VPC->VMWare->VB... but suffice to say, this is the last time I'll touch a Hyper-V instance in my life. For insanity I already have plenty enough lines at ATMs, supermarkets, bus stops, and anything with a PoS terminal, no need for more Microsoft-isms there.

End result:
Image
The Legacy Never Dies

*Don't worry: that old version of $PRODUCT has also finally been deprecated this year, and no new installs will be shipped starting next fiscal year! From now on, all WTFs will be solely from the new shiny codebase AKA mine! :D

_________________
Licensed Pirate® since 2006


2017-10-26 18:52
Previous  1, 2, 3, 4