Woes of Linux Virtualization on Windows 8Published on
Since this article is still getting a significant number of hits, please see this newer post of mine that walks one through, in my opinion, the most optimal way to set up a Linux VM on Client Hyper-V.
First and foremost, I would like to state that I extensively use the Hyper-V feature included in Windows 8. I enjoy it despite what is going to be said here. Currently I have five virtual machines: Windows 7, Windows Server 2012, CentOS 5.8, Linux Mint 13, and Ubuntu 12.04. The Windows virtual machines, by far, work the best. I can remote desktop into the VM, and it will work flawlessly. The seam between virtual and reality can be so thin that sometimes I will forget what operating system I am using.
On the Linux side, things are not as smooth. Here are some current issues I am fighting.
Clock drift. Not a huge problem, mostly an annoyance. The clock on my Linux VM starts to drifts once my Windows 8 installation starts hibernating. This becomes a problem when I use makefiles on projects hosted on my Windows shares, the makefile will complain that a certain file was modified sometime in the future. To get rid of this problem I can set the date manually by executing
sudo date +%T -s "hh:mm".
Lousy connection choices. While I can remote connect into my Windows machines, by default, I can only connect to my Linux VMs using the Hyper-V connection, which frankly doesn’t provide an immersive experience. The lack of audio doesn’t bother me; however, the fact it seems impossible to change the screen resolution does nag. A solution is to use VNC, which I believe provides audio, but I still can’t seem to be able to change the screen resolution.
Loss of access to Windows shares. All my VMs are connected to each other by a set of Windows shares. For the most part, this works flawlessly and I can work on the same project from a multitude of different OSs. The issue is when Windows 8 machine hibernates. When I wake it up and try to resume working on a project from a Linux OS, I will not have access. The only remedy is to completely reboot the VM.
No wireless. Probably my biggest gripe with virtualizing Linux on Windows 8 so far. Other than using a wired connection, there doesn’t seem to be a way to connect the Linux VMs to the internet and to the other VMs. I’ve tried using the legacy network adapter and I’ve even tried to setup up a DHCP server on my Windows Server 2012. Nothing so far has worked, and I’m stuck using a wired connection.
No dynamic memory. Not a problem but more of a feature request. Windows installations have an option for dynamic memory usage, which will appropriate more memory if the VM needs it. Currently the Linux dynamic memory doesn’t work and the VM can get extremely sluggish if they run of out memory. This is why I overestimate how much RAM each will need.
While Microsoft does officially have a Linux integration kit, it only supports certain distributions such as CentOS and RedHat, and even when installed on supported OSs, I still have mixed feelings. While clock drift is fixed, “mouse” drift has taken its place. Whenever I am using my CentOS installation, I have two mice: one which is Hyper-v’s and the other CentOS’s. Only CentOS’s can interact with CentOS, but Hyper-v’s controls CentOS’s cursor and the problem is that these cursors don’t move with the same speed and inertia, requiring a careful balance to interact with the interface.
I realize that what I am doing may be bleeding edge, and for the most part, it works. However, I hope that in the near future Microsoft will fix the few issues mentioned here and make a great product even better.
I have found a way to fix the wireless issue! Simply assign a static IP address to the Linux VM! Sure it may be annoying not having DHCP automatically give one, but having wireless is infinitely better than not having wireless.
Just resolved my issue where I would lose access to my Windows shares. The trick was to first double check that the IP address of my host machine didn’t change. If it did, update correspondingly. Then execute the following bash commands.
I had to execute
umount with the lazy option because I kept getting error with a message “device is busy”.
I also found a workaround to the resolution issue. I’m so excited, I can barely contain myself. I can’t believe it took me this long to figure it out, but the solution is simple. Use SSH and connect via Putty. One
apt-get install openssh-server later and a Putty connection, and I’m coding using all the pixels on my laptop. Some might find Putty ugly, but once I set the appearance just right and immerse myself into full screen mode, I wouldn’t want anything else.
Now I can say after all these months of putting up with these problems I ask ask, “Woes of Linux Virtualization on Windows 8? What Woes?”
I am unsure what I did, but I had to spend the last six hours debugging why I was getting an error message when I had seemingly changed nothing.
What was the cause of this problem? I do not know. I can’t imagine it was installing openssh-server, but then again one can’t be so sure. I do; however, know what the solution was, in my case.
I supply my credentials to
mount via a file, and in the file, I had to add a workgroup line
I also had to use
mount.cifs instead of
mount -t cifs. I could not tell you why. Pause to check something. I actually can tell you the problem. I use two mounted Window shares and they just happened to have flipped IP addresses, which is probably why that eluded my search because I refer to the shares through their names defined in
/etc/hosts and not by their IP addresses. Ridiculous.
Now back to coding.
Sick of these updates yet? I just thought I would drop by and deposit some configurations that ease usage with Putty. Warning, I am new to this method, and basically this is an aggregation of content from stackoverflow
- Install screen. Essentially allows for tabs in a terminal. It has been extremely useful for resuming work when the network cuts out.
- Add the following snippet to your .screenrc file so that the tabs are visible
<ctrl>+a cto create a new tab
<ctrl>+a Ato rename a tab
<ctrl>+a #where # is 0-9 to switch to that tab
Clock drift still a problem?
That’s it. Now Linux will synchronize the time via the internet.