Anyone who’s ever read the comments here knows that the answer to every tech problem is “Switch to Linux.” If you’re curious about what Linux is and how it works, Microsoft can help.

If you’ve ever suffered through a painful Windows update or watched in disbelief as your MacBook decided to slow to a crawl and switch its fan into jumbo-jet-at-takeoff mode, you know that there’s one and only one answer to your woes: “Switch to Linux.”

I kid, of course, but you’ll find that advice offered in earnest if you scroll through the comments here at ZDNet, where an army of open source evangelists regularly preaches the Gospel of Saint Linus in response to even the most vaguely related bit of news about other platforms.

And you know what? I think those commenters have a legitimate point. Anyone who aspires to understand the modern computing landscape should have some experience with platforms other than the one they use regularly because a lot of what you see in Windows, MacOS, and Linux today comes from the same DNA.

In the interest of keeping up with what’s new in Linux, I go through this exercise myself every year or two. So, imagine my surprise when this year I was able to build a functional Ubuntu Linux machine in minutes, without disturbing my current Windows 10 setup. Even more surprising: Microsoft did most of the work.

The magic that made all this possible is the Hyper-V virtualization software included with every PC running Windows 10 Pro or Enterprise. (Sorry, Windows 10 Home users, you’re going to have to upgrade if you want to play along.) Hyper-V’s Quick Create gallery, which can build a new virtual machine in just a few clicks, includes not one but three separate Ubuntu images, including the new Ubuntu 20.04 version.

hyper-v-quick-create.jpg
The Hyper-V Quick Create utility includes three Ubunutu Linux versions

Best of all, these custom images are capable of running in a Hyper-V enhanced session, which means you can choose a custom display resolution or run in a full screen, even spanning multiple monitors, with a performance that’s close to what you’d get running on bare metal. In an enhanced session, your virtual machine can share the Windows Clipboard, local storage, and audio hardware on the host machine.

Once you get everything working, you can fire up that Ubuntu VM in full-screen mode and work with it just as if the Windows 10 host machine weren’t there.

Must read:

Alas, that part about getting everything working isn’t just a figure of speech. The good news is that the two-year-old Ubuntu 18.04.3 Long Term Support (LTS) version worked perfectly, with no futzing required. But the two newer releases had me tearing my hair out. I needed to manually edit a protected Linux configuration file before I could get an enhanced session to work in the latest Ubuntu release (20.04), and the version 19.10 VM hung several times and required at least a dozen restarts (including a few hard resets) before it worked as expected.

Still, after all was said and done, I had three working virtual machines, giving me a pretty decent overview of what’s new in Ubuntu Linux.

Update, June 5, 2020: Via Twitter, Hayden Barnes, Developer Advocate for Ubuntu on WSL and Hyper-V at @Canonical, says, “We know about the xrdp bug in 19.10 and 20.04. The 20.04 image will be patched in the upcoming 20.04.1 LTS update. 19.10 is nearing EOL and will be dropped.”

Update 2, October 1, 2020: The 20.04.1 LTS desktop Ubuntu image was released on July 31, 2020, but as of October 1 it has not yet been integrated into the Quick Create image in Hyper-V. 

Also, as my colleague Mary Branscombe notes, all editions of Windows 10, including Home, offer access to the Windows Subsystem for Linux, which runs the Linux kernel in a lightweight virtual machine and has been freshly updated to WSL2 as of Windows 10 version 2004. As the WSL2 documentation makes clear, this is not a traditional VM experience and it’s best suited for developers who want a command line experience and the ability to run Bash shell scripts and GNU/Linux command-line applications. The ability to run graphical apps in the WSL2 environment is on Microsoft’s roadmap and should be available for testing by Windows Insiders in late 2020 or early 2021. 

If you’d like to try setting up one or more Ubuntu VMs in Windows 10 for your own experimentation, follow these steps.

1. ENABLE THE HYPER-V PLATFORM

This hypervisor is built into all 64-bit Windows 10 Pro, Enterprise, and Education editions, but it’s not enabled by default. You might need to turn on some firmware options on older PCs before you can enable the feature. For full instructions, see “Windows 10: How to enable Hyper-V and create virtual machines.”

2. USE QUICK CREATE TO DOWNLOAD AND INSTALL THE UBUNTU VM

Hyper-V offers two ways to create a new virtual machine. The old fashioned way is to click your way through a tedious multi-step wizard. The much easier solution is to use the Hyper-V Quick Create utility. You’ll find a shortcut in the right pane in Hyper-V Manager, or you can open it directly using the Vmcreate.exe command in the Windows 10 search box.

Choose an Ubuntu version from the gallery on the left, then click the Create Virtual Machine button. That kicks off a download of between 1.6GB (18.04.3 LTS) and 2GB (more recent versions). After the download is complete, the Quick Create utility extracts the image, configures the VM, and then displays a dialog box telling you your virtual machine was created successfully.

linux-vm-created-successfully.jpg
I recommend you edit a few settings before running the VN for the first time.

3. TWEAK A FEW SETTINGS

Although you can get started immediately by clicking Connect, if you have sufficient resources on your Windows 10 host machine, I recommend that you click Edit Settings instead, so you can make a few adjustments first.

Choose Memory from the hardware list for your new VM, and then change the assigned RAM from its default value of 2048 to 4096, which should result in better performance. You can also disable dynamic memory if you want a fixed amount of virtual RAM. You might also want to increase the size of the system disk from its default 12GB. Click Hard Drive, then click Edit, and follow the prompts till you reach the Expand command.

vm-settings-memory.jpg
Feel free to tweak the memory assigned to your Linux VM

Finally, under the Management heading, click Checkpoints and then clear the Use Automatic Checkpoints box. (You can always create a checkpoint manually if you want the ability to roll back changes.)

With those adjustments out of the way, you can close the Settings dialog box and open the VM for the first time.

4. SET UP YOUR USER ACCOUNT

Run through the system configuration for Ubuntu, choosing your default language, time zone, and so on. When you get to the screen where you create your login credentials, leave the default setting at Require my password to log in.

Although it sounds convenient, do not enable the auto-login feature. If you choose this option, you won’t be able to sign in using an enhanced session, and your VM will be forced to run in a relatively small window with a default resolution that you can’t easily change.

This is also a good time to run the Software Updater app and get the latest Ubuntu updates. (Click the waffle icon in the lower-left corner and use the search box to find the app.)

5. SIGN IN USING AN ENHANCED SESSION

You’ll know you’ve started an enhanced session if you see this dialog box in the VM Connect window.

enhanced-session-connect.jpg
Move that slider to the far right to run your VM in a full screen

Slide the switch to choose your display resolution. I prefer to move the slider to the right, to the Full Screen position. If you have multiple monitors and you want your VM to span across them, select the Use All My Monitors checkbox. Click Connect to continue, which opens the Xrdp sign-in dialog box, shown here.

xrdp-login-dialog-box.jpg
Sign in to Xrdp to launch your enhanced Hyper-V session

Enter the username and password you set up when creating your Ubuntu Linux account and click OK. Assuming the gods are not angry, you’ll sign in to your VM and can get to work. You might have to enter your password a second time if you’re not already signed in on the session that you’re connecting to. (If you get a black screen, try pressing Enter.)

All of that should work just fine if you started with an 18.04.3 LTS VM. If you’re using Ubuntu 19.10, you might have to go through the same frustrating sequence of restarts that I did before everything works properly.

For Ubuntu 20.04, everything worked just fine in a basic session, but the option to run an enhanced session wasn’t available until I edited the Xrdp.ini file in /etc/xrdp. This is a protected location, so I had to open an editor with an administrator’s credentials, a task which is neither intuitive nor easy.

I had to change two lines in that ini file. First, change port=3389 to port=vsock://-1:3389. Then change use_vsock=true to use_vsock=false. Close the Vmconnect window and connect to the VM again and you should be able to start an enhanced session. But you might also be required to invoke some minor deities and burn some incense. It’s Linux, after all.

(As I noted earlier, the Canonical/Microsoft team will have a fix for that image with the 20.04.1 update, so the xrdp.ini file won’t require editing.)

And you’re now on your own. You’ll have to find productivity software that allows you to get actual work done. If you’re like me and use mostly Microsoft services, prepare for a heaping helping of frustration.

Microsoft doesn’t currently have any Office apps for Linux, so you’ll need to access your files from a web browser. (Yes, there are Office clones for Linux, including the LibreOffice suite, which is a faithful clone of Microsoft Office 2007. It’s… barely adequate.)

Leave a Reply

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