[RndTbl] Windows activation on Linux VM host?
scott at 100percenthelpdesk.com
Thu Jan 21 07:32:35 CST 2021
Based on a recent experience, I'd say that Windows will not let you get
away with this, but I'd like to know what happens if it's already
activated BEFORE virtualizing.
I used virt-p2v to create a Windows instance of a fresh install. I had
just bought a new machine and thought I would be clever if I did this
before wiping it and installing Ubuntu. It mostly worked. I actually
wrote down what happened and here's the weird story. Licensing is
stupid. When I was done, it told me I needed to activate but then it
complained and said I had the wrong license type for a VM. I forget the
wording of that though.
Also though, afaik you can run without activating indefinitely.
(sorry this is long but it's all true...)
*How To Run a Virtual Windows 10 Desktop*
Microsoft Azure has a 12 month free trial. It's a datacentre service,
where you can run virtual machines in the cloud. Hardware owned and
managed by Microsoft, where you can just create computers in the cloud
and use them.
Creating an instance of Windows 10 Pro is easy. There is a message on
the screen that says "make sure you have a valid Windows license, of one
of these types..." They list them but there is no way to buy them. I
wanted a checkbox that said "charge me $1/month for the license" but it
didn't exist. I used the online chat. They wanted my phone number so a
consultant could call me. I said no. 2 days later they called me anyway.
I told them what I wanted and they said they didn't know the answer. To
be clear, my question was how to buy a Windows license for an Azure
machine. They didn't know. I think I do know the answer, which is SPLA
but The minimum commit for that is $150/month last time I checked.
I happen to have a brand new computer with Windows 10 Pro on it, so I
might as well just virtualize this before wiping it and installing
Ubuntu. It took hours to install the Windows updates, which I decided to
do first before uploading the image. That's normal though. I _should_
have installed the virtio drivers first as well, which would have made
them automatically picked up during the VM creation. virt-p2v noticed
that they were not installed though and use the RTL8139 driver. Very
nice of them to do that. It works just fine, although virtio is faster.
Won't really make a serious difference for this machine though.
I went to Redhat's virt-p2v. On my Ubuntu desktop, "sudo apt-get install
libvirt-tools" and run virt-p2v-make-disk. First USB stick I was going
to use was too small. Only 4GB. Second one was 16GB, which was fine.
After 2 hours it completed making the image. Why it makes the image on
the USB instead of staging it I don't know. This stick isn't bootable. I
forgot, I had trouble with this one before. It works as storage but not
bootable. Used a Kingston 16GB one instead that previously had CentOS
boot image on it. This one took another 2 hours but worked fine.
I ran virt-p2v after setting up my vm host to accept passwordless sudo.
I decided to create a new user for this and set the rule for just that
user in the sudoers file using the visudo command. That way I can delete
the rule and the user after conversion and all is well. Red Hat
recommends using root login, which I don't normally do over ssh, and
since this vmhost is Ubuntu, it's set up for su by default.
I told it to store the new image in /lib/libvirt/images where the other
ones already were. It was going to put it in /tmp by default. I suppose
I could have moved it but why.
This ran overnight. The fresh Windows install was on a 250GB SSD drive.
I think it took 6 hours or more, but I'm not sure that was really the
upload time, maybe more conversion after the fact, which is done by
virt-p2v told me it succeeded. No VM running yet, but this seemed good.
It also left me an xml file in /var/lib/libvirt/images so I used that to
do "virsh create xxxxx.xml" which worked with no modifications. Then I
could connect to it using VNC to check out the network config. At this
point I remembered that I should definitely have turned on remote
desktop before running virt-p2v.
To connect to the vnc port
virsh display vncdisplay machine-name-that-I-gave-it
ssh -L 5910:localhost:5901 smt at vmhost
then vncviewer localhost:5910
The screen was tiny and the lowest res possible but enough to get the IP
using cmd and also turn on remote desktop.
From the VM host command line I verified that rdp was open by "telnet
192.168.122.219 3389" and all is well there.
Now to reach it from my desktop I need some iptables rules on the vmhost
sudo iptables -t nat -I PREROUTING -smy-home-IP-here/32 -dvmhost-IP-here
-p TCP --dport 3389 -j DNAT --to-destination 192.168.122.219
But I get connection refused when doing the telnet test from my desktop.
"sudo iptables -nL" tells me that libvirt does things I didn't think
about. There's a quick fix, relatively obvious. Tell it to ignore its
own rules in the case where I want my rule to matter.:
sudo iptables -I LIBVIRT_FWI -d 192.168.122.219 -s my-home-ip -j RETURN
sudo iptables -I LIBVIRT_FWO -d my-home-ip -s 192.168.122.219 -j RETURN
Now the telnet test works from my my-home-ip. However xfreerdp still
fails to let me log in. It complains about ssl protocols but I know this
is likely authentication issues, based on past experience. I went back
to the vnc console, created a new user with admin privileges (I had been
using Administrator as the only account on this machine), and when I
tried logging in with the new user it worked. Magic.
Now I have a fully functional VM Windows 10 Pro. RDP screen resolution
is fine. I've installed Chrome and other things now.
So the real question is... How do other people deal with technology?
There are dozens of things in this story that the average computer user
would not even come close to dealing with.
On 2021-01-21 2:55 a.m., Trevor Cordes wrote:
> Is it possible to run a virtual Windows (10) on a Linux host running
> something like virtualbox? It has to be normal Win 10 Home or Pro though,
> no corporate licensing.
> I ask because I'm unsure how Windows activation (cursed be!) handles that
> situation. I'd like to be able to run the same host image on 2 different
> boxes (but not at the same time) and not have it moan about activation.
> So I guess the question is more this: does the VM hide/abstract the
> hardware enough from Windows to have it think it hasn't changed boxes?
> (The idea is a portable drive with the VM on it would travel between 2
> locations which are never used simultaneously. Each location would have
> an identical Linux box. Don't ask why; suffice it to say that speed is
> paramount and cloud or net access or remote access won't cut it. Lugging
> the entire box is not an option. Laptop is a very sub-par option.)
> Roundtable mailing list
> Roundtable at muug.ca
More information about the Roundtable