Skip to main content

Installing MS Windows 10 into a Virtual Drive in VirtualBox

In 2018, I used VirtualBox to upgrade a hard drive to be used in my Tivo. It worked great and shortly after that, I used the same technique to install Windows XP on a solid-state drive (SSD) for use in another machine and then Mageia on another drive destined for anoter machine.

I found myself in need of the same proceedure and pulled up my old page and found that Oracle had updated the command involved. The one on my old page, 

$ VBoxManage internalcommands createrawvmdk -filename  /path/to/source_sdk.vmdk -rawdisk /dev/sdk

has been superseded by:

$ VBoxManage createmedium disk --filename=VirtualBox VMs/Tiny10-Install/Tiny10.vmdk --variant=RawDisk --format=VMDK --property RawDrive=/dev/sdd

This change allows some nice new features that might be useful to me in the future, but it did take me a while to figure things out, especially since the solutions offered to the problems I encountered were mostly for Debian-based distros (and many were ancient posts) and had no real applicability to Mageia Linux, hence my documentation here.

One of the first problems, an annoyance really, was that VirtualBox creates a /home directory for the virtual machine files that, by default, has a space in the name. That's fine for MS Windows, but annoying for Linux. That issue can be addressed in several ways. The most common on the command line is to enclose the path entirely in quotes, or to escape the space with a backslash. I prefered in this case to create a symlink to the name-with-a-space with a name-without-a-space so any commands on the command line don't have an issue. Interestingly, Oracle does provide an option under File>Preferences to create a custom directory instead of "VirtualBox VMs" with a space; you just need to set that up manually before you create you very first virtual machine. Why can't Oracle just eliminate the space, at least for their Linux version?

As before, I connected the SSD and looked at dmesg to see that my system identified it as /dev/sdd.

After I changed to the virtual machine's root directory (to make paths simpler), the new incantation for me was:

$ VBoxManage createmedium disk --filename=tiny10.vmdk --variant=RawDisk --format=VMDK --property RawDrive=/dev/sdd

But because of my many errors to get to that point, I had some other issues pop up, and here are the solutions:

1. Fix File and Directory Ownership

$ sudo chown -R hoyt:hoyt /home/hoyt/VirtualBoxVMs/Tiny10-Install/

2. Update File Permissions

Set directory permissions: 

$ chmod 755 "/home/hoyt/VirtualBoxVMs/Tiny10-Install/

Set file permissions: 

$chmod 644 /home/hoyt/VirtualBoxVMs/Tiny10-Install/Tiny10.vmdk

3. Check User Groups

Add yourself to the group -- it may not yet exist: 

$ sudo usermod -aG vboxusers hoyt

4. Our Special Case: Raw Disk Access 

Since this is a special case of accessing a physical drive instead of a virtual drive, add the user to the disk group: 

$sudo usermod -aG disk hoyt

And grant temporary permission to the drive: 

$ sudo chmod 666 /dev/sdd

After doing all this, log out and log back in again to work the magic. After you move the drive and everything is OK, just delete the VM you used. Some of these steps may not be necessary for you, but they did fix all my issues.

When you do install MS Windows on a drive that will be moved to another machine, you must stop the install process JUST AS it reboots while running in the virtual machine. Windows continues its install on reboot that needs to be tailored to the machine it will eventually be run on.

RESOURCES

Oracle VirtualBox User Manual

Use Virtualbox to mount drives and transfer data for Tivo Disk Upgrades

Comments

Popular posts from this blog

DOS4GW.EXE Version 2.01a and Alternative DOS Extenders

DOS4GW.EXE The Tenberry DOS extender DOS4GW.EXE was used by many early DOS games. I still enjoy playing many of these games and DOS4GW.EXE is usable with DOSBox , so they can be played on Linux. However, the version of DOS4GW.EXE that was included with the game was whatever was current at the time. The most recent version that includes many bugfixes that possibly affected the games when used with DOSBox have been fixed in the latest version, 2.01a. It's not free at US$49, but you can downloaded it here . Simply substitute it for whatever version of DOS4GW.EXE your game provided and enjoy the bug-fixed goodness. Tenberry also makes a "high-performance" "pro" version of DOS4GW.EXE, but it costs $300. I think that they could sell quite a few of these to hobby users (since, you know, DOS is dead) for US$5. Open Souce to the Rescue There are better performing, free and Open Source alternatives available and worth a look. DPMI Explained Let's unders...

Unpack those .EXE game files from GOG.com (Plus other un-packers)

I just came upon innoextract today. I have many of the wonderful games from GOG.com, some of which have native Linux Clients. Before now, I've had to use PlayOnLinux or Crossover to install these for use with WINE, then add the Linux client. InnoSetup as a way to create an installer to install the games on Windows.  Daniel Scharrer has created innoextract to allow the unpacking of those archives on a non-Windows platform. The website provides information on using innoextract , but this information from the page is very useful: GOG.com Installers GOG.com installers with a 2.x.x version number on the download page or in the filename use InnoSetup 5.5.0 and cannot be extracted by innoextract 1.2 and older. Older installers use InnoSetup 5.2.3 and usually have no version in the filename. Some GOG.com multi-part installers with version 2.1.x or higher use RAR archives (renamed to .bin) to store the game data. These files are not part of the InnoSetup installer and require...

Lighttpd and Simple Virtual Hosts Configuration.

I manage some websites for car clubs I belong to. They had been paying for web hosting and had some volunteers who knew not quite enough about maintaining and administrating the sites. Having some prior experience with similar small club sites, I volunteered to host them and admin them. With the first site, the pages were a train wreck of PHP and making even a small change on the existing pages caused the site to crash. Way back around the turn of the last century, I had a few Linux user’s groups that wanted a website, so I worked with Cynthia Manuel of Flamingo Internet Navigators to make a template for a web site that would be easy to maintain and easy to add static content. She developed templates that relied on Server Side Includes (SSI) and Cascading Style Sheets (CSS) to make administration and content additions simple and easy, so I ported all the content over to that template and hosted the site myself. Later, another car club needed the same assistance and I ported it ov...