For interesting topics. But remember this is a Linux Forum. Do not post offensive topics that are meant to cause trouble with other members or are derogatory towards people of different genders, race, color, minors (this includes nudity and sex), politics or religion. Let's try to keep peace among the community and for visitors.
No spam on this or any other forums please! If you post advertisements on these forums, your account may be deleted.
Do not copy and paste entire or even up to half of someone else's words or articles into posts. Post only a few sentences or a paragraph and make sure to include a link back to original words or article. Otherwise it's copyright infringement.
You can talk about other distros here, but no MX bashing. You can email the developers of MX if you just want to say you dislike or hate MX.
[I hope this is the correct part of the forum for this.]
Background
I got a shiny new laptop for work to replace my 3rd generation i7 (running AVL) and want to virtualise the existing W11 Pro installation that came with it, literally for one program.
While we are an NPO and get special MS pricing, it doesn't feel right to throw away the licence that came with the hardware in order to buy another licence to run it on that same hardware, just in a VM (I want to use QEMU+KVM in this instance).
I tried using StarWind P2V Migrator, but ran into issues and then discovered on their forum that I'm not alone.
Question
Is anyone doing this successfully into QEMU+KVM? Previously I could install and enter the Windows licence key that was on the sticker under the laptop, but now they've done away with that. I have spent days trying all manner of things and am at the point where asking is (hopefully) quicker.
I JUST did this into a VirtualBox VM... a little different but disk2vhd was the solution. And, I had a little more to do as I was coming form a RAID 0 windows setup.
The license carried over perfectly, no reactivation etc.
So, while I do not know about the qemu-kvm .... it works for VirtualBox. hth
edit: it was disk2vhd
*QSI = Quick System Info from menu (Copy for Forum) *MXPI = MX Package Installer *Please check the solved checkbox on the post that solved it. *Linux -This is the way!
I was a bit concerned to use disk2vhd, as the link on the MS page is to a 2021 file. Also, there does seem to be the potential for licensing issues, as per this article on Windows Forum.
I'll give it a whirl. First need to get to bed though — no need to make tired mistakes.
I've done this quite a few times now for various customers. When converting a fully-blown OS to work in a virtualised environment, it is wisest to drop the resource use of the OS before converting it to a Virtual disk image. There's no point in double loading your RAM and Processor when there's no need to so do. Disable unnecessary services, remove superfluous software, clean the living daylights out of the system and reduce it's footprint to the sanest possible level to achieve ONLY the functions intended within the virtualised environment.
This is my workflow. It can take a fair amount of time, but the gains over the long run after having done this are so significantly it pays for itself in the first week of use!
1) I usually start by preforming similar operations as I would for preparing a drive to run and install Live Linux. Disable Secureboot, Disable Fastboot and fast startup, then use a variety of cleaning apps to remove accumulated junk. By then, I've usually removed anything from 4-36GB worth of unnecessary cruft, so I take a snapshot with Macrium Reflect to ensure I retain a good "clean" copy.
2) I install WinAero Tweaker and on the first run I import a curated list of between 30-36 tweaks to remove advertising, useless cruft and undesirable *!cough* features of Windows. Following a reboot for some of them to take effect, I re-run WinAero Tweaker to reduce up to 30 additional Windows annoyances, half of which are Edge related, then uninstall and remove WinAero Tweaker because some AV products do not like it for the sake of its capacity to make mass changes to the Windows registry, which is ironic seeings as they provide full disclosure and step-by step instructions on how to manually perform all of the actions their tool is capable of changing. I used to do many of these by hand and this app saves me the best part of 20-40 minutes, 2 minutes end to end including a reboot and program removal post completion.
3) Uninstall all undesired and/or unneeded apps, including preloaded Store Apps, and in particular, those that start with Windows. Coupled with the above, these steps not only drop resource use, they also lower the volume of spying MS do. By now the machine should be running at about the same or better speed as it did when new, but I'm mot finished yet.
4) Run some DISM Component Store Cleanup and health checks to see if it thinks any work is needed. As this process is intended to be converted to a VM, and I have a safe image dump of the entire drive, I hold nothing back from here on forwards.
dism /online /cleanup-image /restorehealth
followed by this go-hard version removes all previous versions of drivers, leaving only the latest drivers intact.
dism /online /Cleanup-Image /StartComponentCleanup /ResetBase
followed by
sfc/scannow.
followed by a forced chkdsk which only achieves it's full potential when run from a Command as Administrator prompt.
chkdsk /C: /f Answer Y to let it run on next reboot.
After rebooting, I run the disk optimizer if it's a SSD.
5) At this point, all going well, if the machine is to become a VirtualBox guest, I find and mount the Guest-additions CD Image and preinstall the drivers, then I either run disk2vhd, or I take another MR Snapshot, which I later dump into an empty VirtualBox provisioned guest OS and it's never failed me yet.
I have just completed this for a semi-retired man who has a home based business based on his impeccable skills to remake parts brand new for old cars using his precision machinery which is run from a Laptop which unexpectedly died. The Software to run the machine is an older version that did not need a subscription and he would have had to pay for a new security key plus an expensive ongoing subscription to keep his part time business running, however, he'd lost his install disk for it. I was able to deliver a spark at the right location to the Laptop and bring it back to life sufficient to get all this done and transfer a full operational image dump as a VM onto a totally different machine with none of the usual trip hazards. Mind you, the VM will never have internet access and it doesn't need it.
Mike P
Regd Linux User #472293 (Daily) Lenovo T560, i7-6600U, 16GB, 2.0TB SSD, MX_ahs (ManCave) AMD Ryzen 5 5600G, 32G, 8TB mixed, MX_ahs (Spare)2017 Macbook Air 7,2, 8GB, 256GB SSD, MX_ahs
Thanks m_pav. Disk2vhd is the ticket to ride. I might try that with ivan-hc's vbox appimage one day. Virtual machines are somewhat "immutable" in a sense.
Just for interest sake, one can boot a Windows OS in QEMU. For instance I can boot my redundant Windows 10 OS residing on drive sda while my Bookworm pup frugal files are on sdc. Here are some details from my notes-to-self, on the assumption that the windows drive is seen as the guest virtual drive- hda, and /dev/sdx is the drive containing the actual OS as seen by the host OS (probably sda in most cases). I have not tried this with Windows 11 as I do not have a copy.
Boot a USB with an installed OS
Legacy boot: qemu-system-x86_64 …... -hda /dev/sdx
EFI Boot: qemu-system-x86_64 …… -bios /usr/share/ovmf/OVMF.fd -hda /dev/sdx
or, if boot fails, specify the USB as: -usb -usbdevice disk:/dev/sdx
davidy wrote: Fri Jan 03, 2025 9:56 pm
Thanks m_pav. Disk2vhd is the ticket to ride. I might try that with ivan-hc's vbox appimage one day. Virtual machines are somewhat "immutable" in a sense.
There are a couple of ways to virtualize a real machine. disk2vhd is a Sysinternals application, so I wouldn't worry about its relative age. 2021 is recent as far as Sysinternals updates go. I'd also consider sysprepping the physical machine and making a Clonezilla image of it, which can then be restored onto a VM of similar size by booting the VM with the Clonezilla ISO. I imagine this involves more steps than disk2vhd though.
Geek3579 wrote: Sat Jan 04, 2025 12:23 am
Just for interest sake, one can boot a Windows OS in QEMU
Windows runs just fine under emulation, whether that's QEMU, Hyper-V, or VirtualBox. Hyper-V is fairly limited in running older versions, but I know from experience QEMU and VirtualBox can run every version of Windows back to 3.1 without too much trouble although performance, particularly of multimedia applications, can be hit or miss. A lot of folks might be concerned that Windows 11 demands a new TPM chip or a huge amount of install space, and this simply isn't true.
Either the OS figures out it's being virtualized automagically or you can circumvent the more modern install wizard restrictions. Either way, a lot of the Windows 11 minimum system requirements aren't, and the OS itself will continue to function because it's 30 years old and was designed to run on Alphas and MIPS.
Thank you so very much for all your input. It's clear I need to do this at work, given that it is for work. That can only start happening some time next week.
Until then, this question:
In my preparatory reading I came across Revision, which seems to do a great deal of what @m_pav said he does. Has anyone used it successfully? My deep Windows days stopped soon after I wrote code for Windows 3.1 to get network packets between a real mode driver (living within 640 kiB) to applications running in 386 enhanced mode (above 640 kiB), and I'd prefer not to change my hair colour again
I have a [icode]dd[/icode] image of the machine, so other than time, hosing it won't be a disaster.