Windows

How To Create a Windows Virtual Machine in Linux and Windows

A Windows virtual machine allows us to run a complete Windows installation on Linux or Windows. It will have full support for Windows software, and can also recognize peripheral devices. In this guide, we will create a Windows virtual machine in Linux Mint, Ubuntu, and Windows, using both VirtualBox and the free VMware Workstation Player.

We prepared this guide on Linux Mint 18.1, Ubuntu 16.04 LTS, and Windows 10, using VirtualBox 5.1.22 and VMware Workstation Player 12.5.

It should work on recent earlier and later versions too. If you run into any problems, leave us a comment.

Hardware Check

We need enough RAM and CPU cores to support both the primary and the virtual operating system. But it’s also important that our CPU supports IOMMU.

If our CPU doesn’t support it the technology, or it is disabled, VirtualBox will throw an error.

Windows Virtual Machine in Linux Mint - Ubuntu - Windows 0

Don’t worry, though. Most current PCs will support virtualization, and many older systems too.

Does my CPU support IOMMU (VT-x / AMD-V)?

Checking for virtualization support is as simple as downloading and running SecurAble.

This freeware and portable utility will show at a glance if our CPU supports virtualization.

Windows Virtual Machine in Linux Mint - Ubuntu - Windows 00b

Another important thing is to have virtualization activated on the BIOS/UEFI. Even with a virtualization-capable CPU, if the function is not enabled, it won’t do much good.

Enable VT-x (VT-d / VT-t) for Intel

On modern AMD motherboards, we will find the AMD-V virtualization enabled by default. However, for Intel processors and motherboards, VT-x is disabled on most systems.

We need to enter the BIOS/UEFI of our motherboard to enable it. To enter the BIOS, we usually have to press Delete or one of the F2-F12 keys when the system starts.

Just look for the “Press XX to enter setup” bit on the POST screen or the motherboard manufacturer’s logo screen. On your system, you might find it with different wording.

Windows Virtual Machine in Linux Mint - Ubuntu - Windows 01

Once inside the BIOS / UEFI, we need to search for the feature. We could find it in sections such as CPU Feature…

Windows Virtual Machine in Linux Mint - Ubuntu - Windows 02

…Chipset…

Windows Virtual Machine in Linux Mint - Ubuntu - Windows 03

…System Security…

Windows Virtual Machine in Linux Mint - Ubuntu - Windows 03a

…or even Security -> System. Probably the last place someone would look.

Windows Virtual Machine in Linux Mint - Ubuntu - Windows 04

On some motherboards, it could even be buried under three or four sub-menus, such as Chipset -> North Bridge -> Tylersburg IOH Configuration -> Intel (R) VT for Directed I/O Configuration.

If you have trouble locating the option on your BIOS, check your motherboard’s manual. You can also google your motherboard’s model about virtualization.

How much RAM will I need?

We don’t necessarily need 16GB RAM to set-up a Windows virtual machine on our computer. Usually, a 4GB system is enough for running a single virtual machine, especially if our primary OS is Linux.

Ubuntu and Linux Mint need at least 1GB RAM to work properly and without significant slowdown. Giving 2GB RAM to the Windows virtual machine will make sure that both the host and the virtual OS have enough RAM.

In theory, we can run a Windows virtual machine on a system with just 2GB RAM. But it’s far from the ideal scenario. It’s easy to end up with a slow system and a slow VM, or even make the system crash because of low RAM.

Download a Windows ISO

Since we want to create a Windows virtual machine, it follows that we need a Windows installation medium.

We can grab a free ISO for any version of Windows 7, downloading it either through torrent or with Microsoft links:

The resulting installation will work for 30 days as a trial without activation, for the Home Premium version.

If we prefer Windows 8.1, we can download them straight from Microsoft. But we will need to bypass the product key prompt during the installation.

Finally, Windows 10 is probably the most friendly version to create a Windows virtual machine. The main reason is that we can have a Windows 10 installation indefinitely without an activation.

There is no need to create a Windows installation DVD or USB. VirtualBox can directly load the Windows ISO for the installation.

How to create a Windows virtual machine with VirtualBox

VirtualBox is one of the most popular free and open-source virtualization solutions for any platform, with versions for Windows, Linux, macOS, Solaris, and OpenSolaris.

Another advantage of VirtualBox is that we can install it on a 32-bit OS. VMware Workstation Player is only available for 64-bit operating systems.

Of course, anyone seriously interested in virtualization, especially creating a Windows virtual machine, should ideally already have a 64-bit OS and at least 8GB of RAM. But it’s good to know that VirtualBox is also a solution for older systems.

VirtualBox Installation

To install VirtualBox on Windows, we just need to download and run the Installer.

The installation is simple, and won’t attempt to install unwanted third-party apps.

The easiest way to install VirtualBox on Linux Mint or Ubuntu is through their respective software managers.

On Ubuntu, we can install it through Ubuntu Software.

On Linux Mint, we will find it in the Software Manager.

However, the software managers offer an earlier version of VirtualBox. To install the latest version through the terminal, check out our guide:

Create the Windows virtual machine

Once VirtualBox is up and running, we click on “New” to create our Windows virtual machine.

We need to give a name to the virtual machine. If the name is descriptive, e.g. Windows 7, VirtualBox will automatically select the proper type and a version.

We can create a Windows virtual machine with any version of Windows, including Windows 3.1.

Choosing the correct version is imperative. If we try to install 64bit Windows on a 32bit Virtual machine, we will get an error screen.

Windows Virtual Machine in Linux Mint - Ubuntu - Windows 11a

On the next step, we select how much RAM the Windows virtual machine will use.

For a 32bit Windows virtual machine, the recommended amount is 512MB. But if we have RAM to spare, 2GB (2048MB) would be better for the VM’s performance.

We can change the memory size option anytime, even after we created the Windows virtual machine.

Next, we create a virtual hard drive. This will be a file on our system’s disk that will contain the operating system and the Windows virtual machine files.

The default file type for a VirtualBox disk image is VDI. If we don’t plan to run our virtual machine on another virtualization platform (VMware, Parallels, QEMU, etc.), VDI is the best choice.

By selecting the virtual hard drive to be dynamically allocated, we save space on our physical hard drive. A 1TB dynamic virtual hard drive that only has 15GB of data will only take up 15GB on the physical disk.

At the last step before creating the Windows virtual machine, we select the virtual hard drive’s capacity and location on the disk.

In Linux Mint and Ubuntu, the default location will be within the /home/VirtualBox VMs/ folder.

In Windows, the default location is the C:\Users\(username)\VirtualBox VMs folder

After we hit the “Create” button, our Windows virtual machine is ready.

Windows virtual machine settings

Our new Windows virtual machine is ready for us to install Windows. But it’s a good idea to change some optional settings before we start the virtual machine for the first time.

On General -> Advanced it is convenient to set the Shared Clipboard and Drag’n’Drop as “Bidirectional.”

This way we can copy and paste text from and to the Windows virtual machine. We can also copy files to and from the VM with a simple drag and drop.

For these features to work, we need to install the Guest additions on the virtual OS, which we will cover later in the guide.

On System, we can change the amount of RAM the Windows virtual machine has available, as well as the boot order for the VM. The maximum amount of RAM depends on our system’s physical RAM.

Changing the chipset is necessary only if there is some incompatibility with the virtual OS. The same goes for the rest of the settings on this tab.

On the Processor tab, we can select how many of our system’s cores and threads will the Windows virtual machine access. One or two CPUs are fine for most uses.

On the Display section, we can enable 3D Acceleration and 2D Video Acceleration, and give up to 256MB to Video Memory.

These settings, of course, are not enough to play demanding games in a VM. But they will help with simple games and video playback.

The Video Capture feature is useful for anyone wanting to create tutorial videos, for YouTube or any other use. VirtualBox can create a video of the VM with no external screen-capture program required. For anyone else, this feature is useless.

Storage is an important stop before starting the VM. If we have Windows as an ISO, we need to select the “Empty” DVD icon…

…and load the ISO with the “Choose a Virtual Optical Disk File” option.

If we have Windows on a physical DVD, we can leave the option as is, and VirtualBox will use our DVD drive.

Finally, in the USB section, it’s a good idea to enable the USB 2.0 controller.

For this feature to work, we need to install the Oracle VM VirtualBox Extension Pack.

How to install the Oracle VM VirtualBox Extension Pack

We just need to download the latest pack from https://www.virtualbox.org/wiki/Downloads.

Then we go to File -> Preferences…

…go to the Extensions tab and click on the Add package button…

…and select the downloaded .vbox-extpack file.

Finally, we click on the Install button.

For the installation to proceed, we need to scroll all the way down the VirtualBox License, and, of course, agree with it.

And that’s it. Now every virtual machine can have USB 3.0 and USB 2.0 functionality.

Using a Windows virtual machine on VirtualBox

With the settings done, we only need to start our virtual machine.

The Windows virtual machine will boot from the ISO or the DVD, just like a physical PC. We then go through the Windows installation, which is identical to the installation on a physical computer.

The first time we click inside the Windows virtual machine, VirtualBox will let us know about capturing the mouse and how we can return to the host operating system – the default key is the Right CTRL.

Once we finish with the installation, we have a complete Windows system within our primary OS.

If we try to close the Windows virtual machine from the “X” button, a prompt will ask us what we want to do.

We can Save the machine state, as is, so we can return to the exact point we were, with all the programs running.

The “Send the shutdown signal” will start the Windows’ shutdown procedure.

We should never select the “Power off the machine” unless the Windows virtual machine gets completely stuck, for any reason. It’s like pulling the plug on a physical PC, a violent way to shut it down that could potentially damage the operating system files.

Installing Guest Additions

Guest additions is an application for the virtual operating system. It installs necessary drivers, improves the virtual machine’s video capabilities, and supports the shared Clipboard and drag’n’drop functions.

To install guest additions, with the Windows virtual machine up and running, we access the Devices -> “Insert Guest Additions CD image…” option on VirtualBox.

This will load the application on the Virtual CD.

If we don’t get an AutoPlay prompt, we will find it inside the Computer.

We run the VBoxWindowsAdditions application…

…which, among other things, will install some device drivers for the Windows virtual machine. We can check the “Always trust software from Oracle Corporation” so we won’t get a prompt for every driver.

…and at the end of the installation, we must reboot the virtual machine.

Creating and restoring snapshots

Snapshots are one of the best features of a virtual machine. What they do is that they “freeze” the virtual operating system exactly as it is, with all the software and all the settings.

After a snapshot of a clean and functional system, we can delete all the system files, or install every malware known to man, and it won’t matter. Restoring the snapshot will bring back the clean and functional OS, in an instant.

One way to create a snapshot that we mentioned earlier, is by clicking the virtual machine’s “X” button, and select “Save the machine state.”

We can also create a snapshot with the Windows virtual machine powered off, using the “Snapshots” button.

We click on the “Create Snapshot” button, and we give the snapshot a name. The description is optional.

After that, anytime we want or need to refresh our Windows virtual machine, we select the proper snapshot and restore it.

We can also choose to restore a snapshot when closing a virtual machine. If there is a snapshot, the “Power off the machine” option includes restoring this snapshot.

This will not damage the operating system, like “Power off the machine” can. And it’s an easy way to keep a Windows virtual machine always fresh.

How to connect peripheral devices to the Windows virtual machine

Have you ever had a scanner that only has drivers for Windows XP? A Windows virtual machine is the perfect way to use hardware that demands a particular operating system.

If we are running VirtualBox on Linux, we first need to add our username to the vboxusers group before we connect our first USB peripheral device.

We just fire up a terminal with (ctrl+alt+T) and type:

Notice the capital “-G.” We remind you that Linux commands are case-sensitive. After that, we need to restart the primary operating system.

On the Windows version of Virtualbox, we don’t need to go through any such procedure.

To connect a peripheral USB device on any active Windows virtual machine, we right-click the USB icon and select from the list.

We can do the same from the Devices menu.

For the device to work, we need to install the drivers within the virtual operating system, regardless if it has working drivers on the primary OS or not.

Also, we can have a device connected either to the virtual machine or the host operating system. We can’t have it on both at the same time.

Still, this feature can give a new lease of life on any Windows XP-only device, or allow us to run Windows-only devices on Linux.

How to create a Windows virtual machine with VMware Workstation Player

VMware is the largest virtualization provider, with solutions that span complicated virtual server installations to simple apps for home users.

The company has multiple paid products, but the VMware Workstation Player (ex-VMware Player) is free for non-commercial use.

VMware has two downsides, compared to VirtualBox. The first is that we can only install the VMware Workstation Player on 64-bit systems.It’s impossible to install the VMware Workstation Player on a 32-bit OS, Windows or Linux.

Of course, this will not stop us from creating a 32-bit Windows virtual machine. The 64-bit restriction is just for the host operating system.

The second downside is that the free VMware Workstation Player does not support snapshots. We will only find snapshots on the expensive VMware Workstation.

If neither of the above is a dealbreaker for you, selecting between VMware and VirtualBox is a matter of personal preference. You can try both, and see which you like best. After all, they ‘re both free.

VMware Workstation Player installation

We will find the latest version of VMware Workstation Player here.

On Windows, the installation is simple, as it won’t attempt to install potentially unwanted third-party apps. The only thing we might change is unchecking the “Help improve VMware Workstation Player,” if we are concerned with our privacy.

Also, the first time we open the app, it will ask us whether we want the free version for non-commercial use, or if we have purchased a license key.

We need to add an email to continue with the free version, but VMware doesn’t check in any way if it is a legitimate email. Just fill in something that includes an “@, ” and you’re golden.

Finally, the app might nag us to upgrade to the latest paid Workstation Pro version, but we can just ignore it with “Skip this Version.”

The extra steps to install VMware Workstation Player in Linux

Installing the VMware Workstation Player in Linux is a bit more complicated than both the Windows version and VirtualBox.

After we download the installation file, which has the extension “.bundle,” we need to open a terminal with Ctrl+Alt+T and navigate to the folder where we downloaded the file. Usually, it’s at the Downloads inside our Home folder, which we can access with:

There, we must make the file executable, with the command:

Because the filename is long, we can just type chmod +x VMware…

..and then press the Tab button on the keyboard for the terminal to autocomplete the filename.

Finally, we begin the installation with the following command, again using the Tab button for autocomplete:

From here on, we proceed with the installation using the app’s GUI.

If we are concerned with privacy, we can say “No” to sending anonymous system data and usage statistics to VMware.

And, of course, we leave the license field blank, since we haven’t bought the pro version of the VMware Workstation Player. Just press Next.

Finally, we will find the VMware Player at the Administration section of the Mint menu.

Create the Windows virtual machine

To create a Windows virtual machine, firstly we click on “Create a New Virtual Machine.”

VMware will check our DVD drive for any OS installation media, or give us the option to load an ISO file. There is also the option to just create the virtual machine without choosing an operating system, but we will load a Windows 7 ISO for this guide.

Unless it is a customized ISO, VMware will recognize the operating system and suggest using “Easy Install” for the installation.

The “Easy Install” option offers an entirely automated installation. We just select the version of Windows and enter our Full name. Creating a Windows password or filling in a product key are both optional.

If we don’t enter a product key, VMware just informs us that we have to activate Windows later.

After that, we select a name for the virtual machine and the path where we want it installed.

We also choose the maximum disk size for the virtual drive and whether we want it as a single file or split into multiple files. 60GB will be enough for a Windows virtual machine without too many applications.

On the last page, it’s a good idea to click on the “Customize Hardware” button, to set up a few extra virtual machine options.

Windows virtual machine settings

VMware is more generous with the RAM allocation and will suggest 2048MB for our Windows virtual machine. Depending on our physical RAM, we can increase or decrease this number.

Also, if we own a multi-core multi-threaded CPU, we can increase the number of processor cores for the Windows virtual machine.

Finally, at the USB controller section, we can select USB 2.0 or USB 3.0.

We can also add other types of hardware from the “Add” button at the bottom of the window.

For the time being, though, we are ready to start our Windows virtual machine, and we close the hardware preferences window with “Close,” to return to the previous screen.

With the “Power on this virtual machine after creation” checked, we click on Finish.

Easy Install and the VMware tools

VMware Workstation Player will start the virtual machine and begin installing Windows. Meanwhile, since it is our first virtual machine, the app will ask us to download and install the latest VMware tools.

These tools work exactly like the “Guest Additions” on VirtualBox, by installing specific drivers and allowing extra functionality on our Windows virtual machine.

Meanwhile, the Windows installation continues in an entirely automated fashion.

We can make a coffee or take a nap, and a few minutes later we will return to find the Windows virtual machine up and running, with our desktop ready.

If we attempt to close the virtual machine from the “X” button, we will get a prompt to either suspend the VM or send the shutdown signal to the machine.

How to connect peripheral devices to the Windows virtual machine

On the upper right-hand corner, we will find a << symbol, clicking on which will reveal the available devices.

Each device that we can connect to the virtual machine has its icon.

It’s just a matter of right-clicking and selecting to connect the device, which will disconnect it from the host.

Does a Windows virtual machine need an antivirus?

A Windows installation without an active antivirus can be considered criminal negligence. Especially with drive-by download malware that can infect a system just by visiting a website.

And we ‘re not just talking about shady or x-rated websites, but legitimate pages too.

Windows Virtual Machine in Linux Mint - Ubuntu - Windows 45

Our Windows virtual machine can get infected with malware, just like any other Windows installation. Whether it needs an antivirus or not ultimately comes down to how we will be using it.

If we restore a snapshot every time we shut down the VM, any malware infection will disappear. If we don’t use snapshots, it would be a good idea to have at least a freeware antivirus solution on the VM.

What are your reasons for creating a Windows virtual machine?

Do you have hardware that requires an old version of Windows? Do you want to have a Linux distribution as your primary operating system, and still be able to run Windows applications? Do you wish to experiment with shady websites and programs, with the safety of the snapshot?

Whichever is your reason to create a Windows virtual machine, let us know in the comments below.

Source

Leave a Reply

Your email address will not be published. Required fields are marked *