-
-
Notifications
You must be signed in to change notification settings - Fork 50
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Windows 7 x64 HVM on R4.0 #3592
Comments
Thanks for this, a few comments:
|
Thanks for the feedback. I've edited the doc to reflect your comments and I also added a few 'tweaks'. Interestingly the original doc had the As for the install size, mine comes at 11g for a Win Professional version, but QWT moved the user profiles to the private volume and I've set the pagefile size to 1Go. IIRC the install size before those steps was ~15g. [edit1 - --standaloneclass -> --StandaloneVM] |
I see what you mean,
isn't right (as of rc4) if you need it to be HVM instead of PVH. Might be worth playing with it a bit to see if HVM is really required for a Win7 VM without PCI attached pass-through. Is it just for the install step, and can be changed to PVH after? |
doc: fyi @adubois removed the note in his PR. PVH/HVM: you had me here - I always assumed Windows required HVM, pci devices attached or not. The xen wiki indeed shows that HVM is required, but a ML post seems to indicate PVH is possible (but then that's the only related post I could find). When set to PVH my (otherwise working) windows VM doesn't reach the boot loader because the VM's kernel pref is '' and PVH requires a kernel, resulting in the following (expected) error message:
/var/log/libvirt/libxl/libxl-driver.log:
|
@taradiddles Thank you for checking! It's hard to tell on some of those Xen docs how current they are... |
Yes, Windows require virt_mode hvm. At least for now. |
Thanks for the clarification, I've added a comment in the doc about PVH. |
Sorry coming back to life after far too much work to be able to contribute. Great work, I however have few personal comments:
|
Nope you don't sound negative - I get the idea. The problem with Windows is that you end up loosing a lot of time because 99% of the time you have to begin from scratch when your VM crashes and is unfixable, so IMHO users ought to understand what each command does. For instance if they know that the VM will be totally broken when the windows installer crashes because there's not enough RAM, maybe they'll decide to add more RAM preemptively. But I agree that's debatable. Re- RAM: I don't have any issue lowering it to 2Go on Win7 x64 pro. The page file is fixed at 1Go. But then I don't use heavy apps like photoshop. We could advise users to keep 4Go but without memory balancing windows VMs are a memory hog and not everyone has enough RAM (like issue #3618 - I added a comment in the doc about it). For info I've submitted a PR a few days ago - see here. The PR covers both 3.2 and 4.0, and more stuff than the issue here.
BTW I only use Windows 10min every two weeks. Just went into that doc stuff because I lost a day installing it and thought I'd save the other people some time. So any feedback is welcome to improve the docs - I'm far from a specialist on that specific topic. |
I have done some testing with QWT, and you are right, it is not even in a rc state. Apologies for assuming it was more stable than it is. I have put comments in PR#600. I had written this before adding my comments. your version is better and I think needs to have the spirit of the following... What about having 3 parts for the R4: |
Closing - the instructions are now in the official docs (https://www.qubes-os.org/doc/windows-vm/) |
EDIT - the instructions below are outdated ; updated instructions are in the official docs at https://www.qubes-os.org/doc/windows/
[the purpose of this issue is to gather user experience and fine tune the instructions before submitting a PR to the official documentation]
Qubes OS version:
R4.0
Affected TemplateVMs:
Windows 7 x64 HVM
Related issues:
#3585
#3495
To be discussed:
qvm-clone
(qvm-backup
is far too slow).Edits
qvm-prefs win7new virt_mode hvm
since Qubes 4 defaults to PVHqvm-start
Importing a Windows VM from R3.2
Importing should work, just make sure that you're not using Xen's newer R4 linux stubdomain and that the VM is in HVM mode (these steps should be done automatically when importing the VM):
Note however that you're better off creating a new Windows VM to benefit from the more recent emulated hardware: R3.2 used a MiniOS based stubdomain with an old and mostly unmaintained 'qemu-traditional' while R4.0 uses a Linux based stubdomain with a recent version of upstream qemu (see this post).
Windows 7 x64 install on R4.0
tl;dr;
Most of the commands below can be combined into only a few commands but they're split for the sake of clarity; each command is explained in the next section.
Detailed instructions
Create a VM named win7new in HVM mode (limitations in xen precludes from using PVH):
Windows' installer requires a lot of memory ; 2000m is not enough, the VM will crash and you'll get out of memory errors like this in /var/log/xen/console/hypervisor.log:
Increase to 4000m temporarily (note that memory = maxmen because there's no memory balancing):
We don't want to start a linux kernel so that the VM can boot from the CD:
qvm-prefs win7new kernel ''
A Windows installation needs more than 10g (usually between 15g up to 19g by default depending on the version) and Windows updates usually end up using significant space so
extend the root volume from the default 10g to 25g (note: if 25g aren't enough once Windows is installed, simply extend the volume again in dom0, and then extend the system partition in Windows's disk manager).
qvm-volume extend win7new:root 25g
Set the debug flag to have a graphical console:
qvm-prefs win7new debug True
The second part of the installation process will crash with the standard vga adapter and will stay in "transient" mode with the following error in guest-win7new-dm.log:
Workaround: temporarily switch to the cirrus video adapter:
qvm-features win7new video-model cirrus
The VM is now configured and can be started; the best practice is to use an installation ISO located in a VM:
qvm-start --cdrom=untrusted:/home/user/windows_install.iso win7new
At this point you may open a few tabs in dom0 for debugging should something go amiss:
The VM will shutdown after the installer finishes extracting the files. It's a good idea to clone, backup or snapshot the VM now. Then, (re)start the VM with
qvm-start win7new
.The second part of Windows' installer should then be able to complete successfully. It is then OK to revert to the standard VGA adapter and decrease the VM's memory to a more reasonable value:
At that point you should have a functional windows 7 installation, although without updates, Xen's PV drivers nor Qubes integration. It's a good time to clone the VM again.
Windows update
There is nothing specific to Xen or Qubes when updating the VM with Windows Update.
Depending on how old your installation media is, fully updating your Windows VM may take hours so make sure you clone your VM between the mandatory reboots in case something goes wrong. This comment provides useful links on updating a Windows 7 SP1 VM.
Note: if you already have Qubes Windows Tools installed the VM's video adapter will be set to "Qubes video driver" in which case you won't be able to see the Windows Update process when the VM is being powered off because Qubes services would have been stopped by then. Depending on the size of the Windows update packs it may take a bit of time until the VM shutdowns by itself, leaving one wondering if the VM is crashed or still finalizing the updates (in dom0 a changing CPU usage - eg. shown with
xentop
- usually indicates that the VM hasn't crashed).To avoid guessing the VM's state make sure debugging is enabled (
qvm-prefs win7new debug true
), temporarily re-enable the standard VGA adapter, and disable Qubes' "Qubes video driver" (My computer -> Manage / Device manager / Display adapters).Xen PV drivers + Qubes integration
If you plan to update your newly isntalled Windows VM it is recommended that you do so before installing Qubes Windows Tools (QWT). If QWT are installed, you should temporarily re-enable the standard VGA adapter in Windows (see the section above).
Installing QWT on R4.0 requires using QWT for Qubes R3.2. See issue #3585 for instructions and known issues.
Qubes Windows Tools install Xen's PV drivers by default so there is no need to install the official ones. However, Xen's VBD (storage) PV driver is disabled by default during QWT's setup and enabling it on a Windows 7 VM that isn't fully updated results in a BSOD and broken VM. Updating Windows takes hours and for casual usage there isn't much of a performance difference with or without the storage PV driver; so there is likely no need to go through the lengthy Windows Update process if your VM is isolated from the network and you don't use I/O intensive apps.
Once QWT is installed you can now turn off debugging (early graphical console):
qvm-prefs win7new debug False
And increase qrexec_timeout:
qvm-prefs win7new qrexec_timeout 300
Useful tweaks
The text was updated successfully, but these errors were encountered: