Pain and gain of running virtual machines on a Microsoft Surface Book
One of the best features in Windows 10 is that Microsoft OneCore, the unified core common to all Windows 10 versions, from mobile, to desktop, and IoT, is designed to support many programming languages and many different types of shell integration.
Most notably, Bash was the first to be implemented as a way to run Linux applications natively within a full Ubuntu Linux subsystem.
Microsoft has turned a completely different page in regard to the open source community,in recent years, and has been extremely active in the development of open source applications and provision of coding tools for many other languages as well, outside of the Azure platform.
With that said, those who may not need to run Linux programs natively, and have no specific requirements in terms of extreme performance, often opt for setting up a virtual machine, which can be sufficient when running server applications that can only work on Linux, for instance.
Server applications are typically designed to run on relatively low resources. As Ling as the machine is resilient enough , stay on 24/7, anything with a 1GHz processor and 4GB of RAM will do just fine.
With that in mind, other reasons to run a mini installation of Linux in a virtual machine can be the need to run a secure file server that needs to exist only temporarily, think of an on-the-fly Google Drive that exists only on your laptop.
A number of Microsoft Surface Book owners have already tinkered with their convertible laptop, which incidentally has the right combination of specs to fit the profile of virtual machine host, almost perfectly.
Almost is actually a big component, as setting up virtual machines is neither fun, nor easy for the uninitiated. Fortunately, while third party alternatives exist, for a price, Microsoft provides its own brand of utilities to manage virtual machines in Windows 10.
Introducing Hyper-V
Hyper-V is an application that comes with Windows 10 Pro, Enterprise and Education licenses, and it's one of the least painful ways to create and manage virtual machines in Windows 10, running any desktop operating system.
The first thing to understand about Hyper-V is that it's built for server applications first, if that weren't obvious enough.
Surface Book isn't exactly like a server, but it's configuration and storage capacity allows for decent server-like functionality.
For those who own a 1TB SSD version of the Surface Book, or even half that, will find that the device has plenty of room to install several concurrent operating systems of different flavors, as most operating systems, as well , their install images rarely go over the 5GB mark, with some Linux distros being small enough to fit in a thumb drive.
The Intel Core i7 in the Surface Book is also well above the specs required by a small server computer, especially if we run two operating systems at a time or less.
Back to Hyper-V, the caveats can be daunting to overcome for those less experienced.
Creating the first virtual machine in Hyper-V, is accomplished in a number of steps, starting with typing “hyper-v” in Cortana, which should display the blue Hyper-V icon in the applications section.
When Hyper-V is open and initialized, the name of the host computer will appear listed under Hyper-V Manager. Right-clicking on the host computer, and selecting New > virtual machine, will prompt us with a dialog box offering some choices on the configuration of the new virtual box, and what operating system will it run on.
The whole process is structured as a wizard, which should be easy enough to follow, in order to create a basic virtual machine.
The first page of the wizard requires a name to be given to the machine, which can be anything, and can also have spaces and special characters.
Next page will ask what generation of Hyper-V the machine must be created with. Generation 1 covers older computers with legacy hardware like floppy disks and old network cards, while the second generation supports the latest features like Bitlocker and UEFI.
Both generations will work just fine in most cases with most operating systems, but if you plan to install Linux version like freeBSD, or any other non-typical distros, there may be adjustment that must be made after the machine is in place.
In the next screen, we'll specify the amount of RAM available to the virtual machine. Typically leaving this at 1024MB will work just fine, as the memory will be adjusted as needed later by Hyper-V.
We'll skip the networking setup for now, and go straight to configuring the virtual hard disk, which is basically the name and location of the big file that will contain the operating system we'll be running.
Creating and running it on an SSD will make virtual machine operations a lot smoother.
Finally, the installation options will give us a chance to preload an installation image of the operating system we want to set up as soon as we run our new virtual machine.
A word on setup images
Hyper-V supports only ISO image files, however Windows 10 allows to mount IMG files natively, which will display as DVD drives, that can be loaded by Hyper-V. This however is a bit of a hit and miss, so it may be advisable to load IMG files into bootable USB sticks.
Once we reach the last page and click on Finish, our virtual machine will be created, and in theory we should be done and ready.
Post fixes - Getting Internet connectivity
In actuality, anybody who got their hands on Hyper-V for the first time, will begin to differ, as there are a couple of steps we need to follow through before we can finally enjoy the fruit of our labor.
First of all, running our virtual machine as is, will result in running a virtual operating system either no Internet connectivity. The reason is that everything in a virtual machine is virtual, including the hardware, such a network cards, audio, Webcam, printers... everything is simulated with drivers that may, or may not play nice with the actual hardware on the host computer.
Fortunately, getting Internet to work within our virtual machine takes a modest amount of tinkering.
First thing we need to do is to look on the right section of Hyper-V Manager, under the name of our host computer, and click on Virtual Switch Manager.
The Virtual Switch Manager is where we create a network connection for all virtual machines we’ll be creating. We can create as many virtual switches as we like, but unless we run a full-size multi-rack server, one is plenty.
Let’s click on Internal, and click on the button that says Create Virtual Switch. At this point, we’ll give the new switch a name, and we’ll configure it as Internal Network.
You’ll notice there is an external option too, but in most cases, it won’t work, and will also kill your Internet connection.
Creating an internal switch, will display a new vEthernet adapter in Control Panel > Network and Internet > Network Connections.
By itself, this new virtual adapter can only allow for LAN connections to and from the host computer, but if we select both this virtual adapter, and our active Internet adapter, such as the Wireless receiver on the Surface Book, right-click on the selection, and click on Create Network Bridge, will result in a new Network Bridge adapter that will enable vEthernet to reach the open Internet, and which in turns will deliver an active Internet connection to the virtual machine.
At this point, if we run the machine by double clicking on it, from within Virtual Machines, we’ll be greeted by a 1024x768 resolution window displaying the Hyper-V bootloader, where the loaded ISO will initialize and start the setup of our operating system of choice.
Secure Boot
Just as we think everything is going great, the installation fails. Why? The answer can be found within the Settings of our new virtual machine, under Security.
As mentioned earlier, Generation 2 of Hyper-V includes a whole lot of brand new features, such as hardware-based security, like TPM 2.0 and Secure Boot.
Speaking of the latter, Secure Boot will actively block any operating system that tries to modify the partition table, and any software that tries to run unauthorized code at boot time. This happens when operating systems like Linux, for instance, try to replace the current bootloader, or install a new one, such as Grub. In that case, disabling Secure Boot will allow regular setup operations. Linux distros that support UEFI, however, such as Ubuntu, will be able to work with Secure Boot enabled, as long as the option Microsoft UEFI Certificate Authority is selected in the drop down menu under the Secure Boot checkbox.
Once we take care of this last detail, we are finally ready to install any operating system we choose.
Ready to shop?
PortableOne has the best deals on Microsoft Surface Book laptops, and more powerful devices for work and downtime.