How To Install Windows 8.1 In Virtualbox

0 views
Skip to first unread message

Grimarlon Varner

unread,
Aug 5, 2024, 2:00:30 PM8/5/24
to lasiludtio
VirtualBox is kind of a hypervisor that provides us with an environment to run multiple virtual operating systems like Windows, Linux, etc at the same time. A virtual operating system provides us free to use the operating system free of cost to test our newly created software before running it on our actual operating system. If not for virtualization, we would have been required to buy a new computer to run a new operating system which would have been costly. But with virtualization, we can run multiple operating systems on the same machine. Here we will try to run a Windows 10 operating system on our Virtual Box as a guest machine.

Download Virtual box from here. Select your host according to your operating system. For example, people having Windows Host will select Windows hosts from the link given below. For further reference, the installation of virtual box on windows can be understood.


After setting up your Virtual Box, Search Microsoft Windows Evaluation 10 and download Windows 10 ISO file from microsoft.com (free trial only available for 90 days). Then fill up all the requirements and click on Continue to download it. Note that you have to register before moving to the ISO file download page as shown below.


Start the installation of the Windows 10 operating system. Select a name, then the type as MS Windows and the version as Windows 10(64-bit) with respect to the machine used. Then provide memory according to our RAM size preferably 2-4GB and then leave the Hard disk file type as VDI, then select the virtual hard disk size, and you are done as shown below


Then provide memory according to our RAM size preferably 2-4GB. We have selected here 1GB which is 1024MB for demonstration purposes but on your computer, we would prefer to allocate at least 2048MB of memory.


believe me I dislike Windows, but is not because I love it somuch that I need to have a windows container. My company heavily relies on Windows, that is not going to be matter of hours/days to move our products to a platform independent env.


If you must deploy a hypervisor, WSL2 or Hyper-V is a mess to deploy on a windows box that is nested in ESXi is a mess, and a real pain to get up and running. Virtualbox with Docker Toolbox maybe a valuable option here is the github.


Good post @rimelek !

Yes, shortly after I made that post I realized that docker toolbox is no longer supported by docker. Therefore I gave in and deployed Hyper-V with WSL2 (not sure if both are needed or not). Here are the instructions and links I followed to get it all done:


I have never used QEMU on Windows. Only on Linux with KVM, but I used UTM on MacOS to install a Linux OS and install Docker. UTM is based on QEMU. It worked but the performance will depend on your machine.


I use VirtualBox frequently to create virtual machines for testing new versions of Fedora, new application programs, and lots of administrative tools like Ansible. I have even used VirtualBox to test the creation of a Windows guest host.


Never have I ever used Windows as my primary operating system on any of my personal computers or even in a VM to perform some obscure task that cannot be done with Linux. I do, however, volunteer for an organization that uses one financial program that requires Windows. This program runs on the office manager's computer on Windows 10 Pro, which came preinstalled.


This financial application is not special, and a better Linux program could easily replace it, but I've found that many accountants and treasurers are extremely reluctant to make changes, so I've not yet been able to convince those in our organization to migrate.


This set of circumstances, along with a recent security scare, made it highly desirable to convert the host running Windows to Fedora and to run Windows and the accounting program in a VM on that host.


The physical computer already had a 240GB NVMe m.2 storage device installed in the only available m.2 slot on the motherboard. I decided to install a new SATA SSD in the host and use the existing SSD with Windows on it as the storage device for the Windows VM. Kingston has an excellent overview of various SSD devices, form factors, and interfaces on its web site.


That approach meant that I wouldn't need to do a completely new installation of Windows or any of the existing application software. It also meant that the office manager who works at this computer would use Linux for all normal activities such as email, web access, document and spreadsheet creation with LibreOffice. This approach increases the host's security profile. The only time that the Windows VM would be used is to run the accounting program.


Before I did anything else, I created a backup ISO image of the entire NVMe storage device. I made a partition on a 500GB external USB storage drive, created an ext4 filesystem on it, and then mounted that partition on /mnt. I used the dd command to create the image.


I installed the new 500GB SATA SSD in the host and installed the Fedora 32 Xfce spin on it from a Live USB. At the initial reboot after installation, both the Linux and Windows drives were available on the GRUB2 boot menu. At this point, the host could be dual-booted between Linux and Windows.


Now I needed some information on creating a VM that uses a physical hard drive or SSD as its storage device. I quickly discovered a lot of information about how to do this in the VirtualBox documentation and the internet in general. Although the VirtualBox documentation helped me to get started, it is not complete, leaving out some critical information. Most of the other information I found on the internet is also quite incomplete.


First, I installed the most recent version of VirtualBox on the Linux host. VirtualBox can be installed from many distributions' software repositories, directly from the Oracle VirtualBox repository, or by downloading the desired package file from the VirtualBox web site and installing locally. I chose to download the AMD64 version, which is actually an installer and not a package. I use this version to circumvent a problem that is not related to this particular project.


The installation procedure always creates a vboxusers group in /etc/group. I added the users intended to run this VM to the vboxusers and disk groups in /etc/group. It is important to add the same users to the disk group because VirtualBox runs as the user who launched it and also requires direct access to the /dev/sdx device special file to work in this scenario. Adding users to the disk group provides that level of access, which they would not otherwise have.


I then created a directory to store the VMs and gave it ownership of root.vboxusers and 775 permissions. I used /vms for the directory, but it could be anything you want. By default, VirtualBox creates new virtual machines in a subdirectory of the user creating the VM. That would make it impossible to share access to the VM among multiple users without creating a massive security vulnerability. Placing the VM directory in an accessible location allows sharing the VMs.


I created the VM without a virtual disk. The Type should be Windows, and the Version should be set to Windows 10 64-bit. Set a reasonable amount of RAM for the VM, but this can be changed later so long as the VM is off. On the Hard disk page of the installation, I chose the "Do not add a virtual hard disk" and clicked on Create. The new VM appeared in the VirtualBox Manager window. This procedure also created the /vms/Test1 directory.


I did this using the Advanced menu and performed all of the configurations on a single page, as seen in Figure 1. The Guided Mode obtains the same information but requires more clicks to go through a window for each configuration item. It does provide a little more in the way of help text, but I did not need that.


Then I needed to know which device was assigned by Linux to the raw Windows drive. As root in a terminal session, use the lshw command to discover the device assignment for the Windows disk. In this case, the device that represents the entire storage device is /dev/sdb.


Instead of a virtual storage device located in the /vms/Test1 directory, VirtualBox needs to have a way to identify the physical hard drive from which it is to boot. This identification is accomplished by creating a *.vmdk file, which points to the raw physical disk that will be used as the storage device for the VM. As a non-root user, I created a vmdk file that points to the entire Windows device, /dev/sdb.


The next step was to add this vmdk disk to the storage devices for our VM. In the settings menu for the Test1 VM, I selected Storage and clicked on the icon to add a hard disk. This opened a dialog that showed the Test1vmdk virtual disk file in a list entitled Not attached. I selected this file and clicked on the Choose button. This device is now displayed in the list of storage devices connected to the Test1 VM. The only other storage device on this VM is an empty CD/DVD-ROM drive.


There was one more item to configure before the new VM would work. Using the VirtualBox Manager Settings dialog for the Test1 VM, I navigated to the System ==> Motherboard page and placed a check in the box for Enable EFI. If you do not do this, VirtualBox will generate an error stating that it cannot find a bootable medium when you attempt to boot this VM.


The virtual machine now boots from the raw Windows 10 hard drive. However, I could not log in because I did not have a regular account on this system, and I also did not have access to the password for the Windows administrator account.

3a8082e126
Reply all
Reply to author
Forward
0 new messages