How do I run my Windows dual-boot drive in a virtual box?

I have two NVME boot drives, one with Bazzite and one with Windows. My goal with this question is to boot into Bazzite natively, and then run my actual Windows drive within a virtual box so that I don't have to reboot to use Excel. I intend to keep the Windows drive fully intact and bootable, and for changes in the virtual box to reflect when I boot into Windows. If virtualization is pretending that Windows is installed, then I want to pretend to pretend that Windows is installed. While I've been made aware that yes this is possible, I am a little lost setting it up and have had a hard time finding information catered to the Atomic platform let alone Bazzite. Any help would be greatly appreciated. Thus far I have run ujust setup-virtualization and have selected all the options and rebooted, I can confirm virtualization is active, because the Virtual Machine Manager flatpak is able to connect to qemu:///system
216 Replies
Ygypt
YgyptOPā€¢3w ago
@HikariKnight I've been told to tag you since you're the neighborhood friendly virtualization expert šŸ˜„
CheckYourFax
CheckYourFaxā€¢3w ago
1) Make sure IOMMU is available: sudo dmesg | grep -e IOMMU It will say something like "performance counters supported, detected AMD/Intel IOMMU"
Ygypt
YgyptOPā€¢3w ago
No description
CheckYourFax
CheckYourFaxā€¢3w ago
sudo isn't working for some reason??? did it ask you for password?
Ygypt
YgyptOPā€¢3w ago
That terminal was idle for so long that sudo timed out but never re-asked for password so it would just auto-fail lol, I opened a new term and got this
No description
CheckYourFax
CheckYourFaxā€¢3w ago
perfect so IOMMU is wroking 2) Install VFIO driver
Ygypt
YgyptOPā€¢3w ago
Already did that
CheckYourFax
CheckYourFaxā€¢3w ago
Perfect 3) Identify the NVME drive you want to passthrough sudo lspci | grep -i nvme
Ygypt
YgyptOPā€¢3w ago
Like my post says, ran ujust setup-virtualization and clicked on everything
CheckYourFax
CheckYourFaxā€¢3w ago
Run sudo lspci | grep -i nvme and post it here make sure to post the one here that has the Windows install make ABSOLUTE sure its the windows install one although its unlikely it will even work if you accidentally choose the wrong one, but it's better safe than sorry
Ygypt
YgyptOPā€¢3w ago
So what I've reached at this point is running ls -l /dev/disk/by-id and then plugging in the desired disk to the field for "Import existing OS", i get an error message that makes me believe that virt-manager might not have the necessary privileges
No description
No description
CheckYourFax
CheckYourFaxā€¢3w ago
Basically we want to isolate the Windows NVMe drive from being loaded by the kernel That's just import you want a live windows install on a real disk right?
Ygypt
YgyptOPā€¢3w ago
Yeah
CheckYourFax
CheckYourFaxā€¢3w ago
then its absolute best to get IOMMU working and pass the NVMe drive through this will also lead to best performance unless you want to also access the NVMe drive in Linux, but I'm assuming not???
Ygypt
YgyptOPā€¢3w ago
Right so is that something I do from virt-manager or do I use a cli for that
CheckYourFax
CheckYourFaxā€¢3w ago
use cli for the coming steps virt manager is for last we first want to isolate the drive for passthrough sudo find /sys/kernel/iommu_groups/ Can you post the output of this here?
Ygypt
YgyptOPā€¢3w ago
/sys/kernel/iommu_groups/
/sys/kernel/iommu_groups/17
/sys/kernel/iommu_groups/17/devices
/sys/kernel/iommu_groups/7
/sys/kernel/iommu_groups/7/devices
/sys/kernel/iommu_groups/15
/sys/kernel/iommu_groups/15/devices
/sys/kernel/iommu_groups/5
/sys/kernel/iommu_groups/5/devices
/sys/kernel/iommu_groups/23
/sys/kernel/iommu_groups/23/devices
/sys/kernel/iommu_groups/13
/sys/kernel/iommu_groups/13/devices
/sys/kernel/iommu_groups/3
/sys/kernel/iommu_groups/3/devices
/sys/kernel/iommu_groups/21
/sys/kernel/iommu_groups/21/devices
/sys/kernel/iommu_groups/11
/sys/kernel/iommu_groups/11/devices
/sys/kernel/iommu_groups/1
/sys/kernel/iommu_groups/1/devices
/sys/kernel/iommu_groups/18
/sys/kernel/iommu_groups/18/devices
/sys/kernel/iommu_groups/8
/sys/kernel/iommu_groups/8/devices
/sys/kernel/iommu_groups/16
/sys/kernel/iommu_groups/16/devices
/sys/kernel/iommu_groups/6
/sys/kernel/iommu_groups/6/devices
/sys/kernel/iommu_groups/24
/sys/kernel/iommu_groups/24/devices
/sys/kernel/iommu_groups/14
/sys/kernel/iommu_groups/14/devices
/sys/kernel/iommu_groups/4
/sys/kernel/iommu_groups/4/devices
/sys/kernel/iommu_groups/22
/sys/kernel/iommu_groups/22/devices
/sys/kernel/iommu_groups/12
/sys/kernel/iommu_groups/12/devices
/sys/kernel/iommu_groups/2
/sys/kernel/iommu_groups/2/devices
/sys/kernel/iommu_groups/20
/sys/kernel/iommu_groups/20/devices
/sys/kernel/iommu_groups/10
/sys/kernel/iommu_groups/10/devices
/sys/kernel/iommu_groups/0
/sys/kernel/iommu_groups/0/devices
/sys/kernel/iommu_groups/19
/sys/kernel/iommu_groups/19/devices
/sys/kernel/iommu_groups/9
/sys/kernel/iommu_groups/9/devices
/sys/kernel/iommu_groups/
/sys/kernel/iommu_groups/17
/sys/kernel/iommu_groups/17/devices
/sys/kernel/iommu_groups/7
/sys/kernel/iommu_groups/7/devices
/sys/kernel/iommu_groups/15
/sys/kernel/iommu_groups/15/devices
/sys/kernel/iommu_groups/5
/sys/kernel/iommu_groups/5/devices
/sys/kernel/iommu_groups/23
/sys/kernel/iommu_groups/23/devices
/sys/kernel/iommu_groups/13
/sys/kernel/iommu_groups/13/devices
/sys/kernel/iommu_groups/3
/sys/kernel/iommu_groups/3/devices
/sys/kernel/iommu_groups/21
/sys/kernel/iommu_groups/21/devices
/sys/kernel/iommu_groups/11
/sys/kernel/iommu_groups/11/devices
/sys/kernel/iommu_groups/1
/sys/kernel/iommu_groups/1/devices
/sys/kernel/iommu_groups/18
/sys/kernel/iommu_groups/18/devices
/sys/kernel/iommu_groups/8
/sys/kernel/iommu_groups/8/devices
/sys/kernel/iommu_groups/16
/sys/kernel/iommu_groups/16/devices
/sys/kernel/iommu_groups/6
/sys/kernel/iommu_groups/6/devices
/sys/kernel/iommu_groups/24
/sys/kernel/iommu_groups/24/devices
/sys/kernel/iommu_groups/14
/sys/kernel/iommu_groups/14/devices
/sys/kernel/iommu_groups/4
/sys/kernel/iommu_groups/4/devices
/sys/kernel/iommu_groups/22
/sys/kernel/iommu_groups/22/devices
/sys/kernel/iommu_groups/12
/sys/kernel/iommu_groups/12/devices
/sys/kernel/iommu_groups/2
/sys/kernel/iommu_groups/2/devices
/sys/kernel/iommu_groups/20
/sys/kernel/iommu_groups/20/devices
/sys/kernel/iommu_groups/10
/sys/kernel/iommu_groups/10/devices
/sys/kernel/iommu_groups/0
/sys/kernel/iommu_groups/0/devices
/sys/kernel/iommu_groups/19
/sys/kernel/iommu_groups/19/devices
/sys/kernel/iommu_groups/9
/sys/kernel/iommu_groups/9/devices
its lengthy
CheckYourFax
CheckYourFaxā€¢3w ago
sorry comamnd is wrong Type sudo find /sys/kernel/iommu_groups/ without the type Also need the output of sudo lspci | grep -i nvme
Ygypt
YgyptOPā€¢3w ago
CheckYourFax
CheckYourFaxā€¢3w ago
there you go perfect now also output of sudo lspci | grep -i nvme
Ygypt
YgyptOPā€¢3w ago
lspci is not installed on bazzite but I know the drive by id
CheckYourFax
CheckYourFaxā€¢3w ago
what is the drive id? specifically the IOMMU ID not the mounted /dev/
Ygypt
YgyptOPā€¢3w ago
that I dont know, I'm just saying I know the /dev/disk/by-id if that helps us find the IOMMU id
CheckYourFax
CheckYourFaxā€¢3w ago
lspci should be on bazzite you sure you're typing it correctly?
Ygypt
YgyptOPā€¢3w ago
Naw problem was I ran it in my distrobox term and not my main window lul
CheckYourFax
CheckYourFaxā€¢3w ago
lspci lists pci devices
Ygypt
YgyptOPā€¢3w ago
yeah ik
CheckYourFax
CheckYourFaxā€¢3w ago
oh lol you'll probably get at least two id's because you ahve two NVMe drives you need to tell me which one is the windows NVMe
Ygypt
YgyptOPā€¢3w ago
problem is that just lists the device manufacturer name and not a unique id
CheckYourFax
CheckYourFaxā€¢3w ago
it does all the way at the start
Ygypt
YgyptOPā€¢3w ago
I'm going to need to get mount information for these because both windows and linux use the exact same model of nvme but one has 3 parts and one has 4, that's how I tell them apart
CheckYourFax
CheckYourFaxā€¢3w ago
we need to figure out which device is in whice IOMMU group if they're both in the same IOMMU group, passthrough ain't gonna work but it looks like you're safe sudo blkid
Ygypt
YgyptOPā€¢3w ago
They are seperate entries one is 5:0 and one is 1:0
CheckYourFax
CheckYourFaxā€¢3w ago
this is the command you need
Ygypt
YgyptOPā€¢3w ago
blkid has no output
CheckYourFax
CheckYourFaxā€¢3w ago
you have to do its been a while for me sorry but its do lspci -v make sure you're not in distrobox
Ygypt
YgyptOPā€¢3w ago
already did that, it doesnt provide any differentiating info except that one device is in group 14 and one in 15. I know the UUIDs from lsblk tho, is there anywhere that cross-references the IOMMU groups with actually unique information?
CheckYourFax
CheckYourFaxā€¢3w ago
there you go, so we know they're separate groups at least
Ygypt
YgyptOPā€¢3w ago
because other than the IOMMU groups, lspci does not provide unique indentifying information for these drives
CheckYourFax
CheckYourFaxā€¢3w ago
@Ygypt you can just check using file manager which is the bazzite install dolphin or whatever it is in gnome again
Ygypt
YgyptOPā€¢3w ago
Upon reboot, will these devices be put into the same groups let alone the same IDs
CheckYourFax
CheckYourFaxā€¢3w ago
@Ygypt do sudo lsblk -o NAME,FSTYPE,SIZE,MOUNTPOINT,UUID and post output here also sudo lspci -v
Ygypt
YgyptOPā€¢3w ago
I've already indentified the drive I need it's IOMMU is 5:0 in group 15, what's next
CheckYourFax
CheckYourFaxā€¢3w ago
I want to try if it will work without binding it to the VFIO first make sure device is not mounted at boot Open virt-manager Manual install Choose Windows 10/11 whatever you're using Add memory and CPU Don't touch storage at all when you make the VM choose customize configuration before install Then when you open the VM there will be a pop up to add hardware to the VM Then Add PCI host device select the Windows NVMe drive Click "apply" and then begin installation. It should just boot to Windows at that point If this works then no extra setup required @Ygypt
Ygypt
YgyptOPā€¢3w ago
Ok so one i just want to point out,
Don't touch storage at all when you make the VM choose customize configuration before install Then when you open the VM there will be a pop up to add hardware to the VM Then Add PCI host device select the Windows NVMe drive
this is all i needed to know as far as steps go, you shoulda told me this in the first place brother more importantly, I cant actually create a machine even witohut storage the error on the second image appears no matter what. Like i said before, i think virt-manager is having trouble connecting to the virtualization daemon
Ygypt
YgyptOPā€¢3w ago
I believe this flatpak has permission issues
No description
Ygypt
YgyptOPā€¢3w ago
Would you reccomend layering virt-manager
CheckYourFax
CheckYourFaxā€¢3w ago
No Are you sure you selected Add $USER to libvirt group? and then rebooted?
Ygypt
YgyptOPā€¢3w ago
Yup
CheckYourFax
CheckYourFaxā€¢3w ago
in ujust setup-virtualization Reboot again just to be sure
Ygypt
YgyptOPā€¢3w ago
Like I said in my post:
Thus far I have run ujust setup-virtualization and have selected all the options and rebooted
CheckYourFax
CheckYourFaxā€¢3w ago
layering virt manager ain't gonna do anything since this is a file access issue Can you type sudo ls /var/log/libvirt/
Ygypt
YgyptOPā€¢3w ago
thats unnecessary
No description
CheckYourFax
CheckYourFaxā€¢3w ago
does this even exist
Ygypt
YgyptOPā€¢3w ago
It does
CheckYourFax
CheckYourFaxā€¢3w ago
systemctl status virtlogd
Ygypt
YgyptOPā€¢3w ago
There's an active daemon running
CheckYourFax
CheckYourFaxā€¢3w ago
this has to do with the kvmfr module you chose that option too? this is for looking glass
Ygypt
YgyptOPā€¢3w ago
virt-manager even recognizes that and automatically connected to qemu/kvm like i said
CheckYourFax
CheckYourFaxā€¢3w ago
looking glass is so you can gpu passthrough on the same screen without atatching a screen directly to the passed through gpu
Ygypt
YgyptOPā€¢3w ago
There were 3 options and I selected them all
CheckYourFax
CheckYourFaxā€¢3w ago
3 options? there should be 5 with uninstall options or 6 even are you sure you didn't uninstall? lmao
Ygypt
YgyptOPā€¢3w ago
two of them are just for disabling
CheckYourFax
CheckYourFaxā€¢3w ago
yes correct
Ygypt
YgyptOPā€¢3w ago
there are 3 installation options and i did them all
CheckYourFax
CheckYourFaxā€¢3w ago
sudo restorecon -r /var/log/libvirt try again after
Ygypt
YgyptOPā€¢3w ago
It still throws the error
CheckYourFax
CheckYourFaxā€¢3w ago
@HikariKnight help Let me do some digging. If I can find anything I'll continue helping. If not we're going to have to wait for Hikari It's probably an SELinux thing I found a similar issue already: https://discord.com/channels/1072614816579063828/1326992075740155976
Ygypt
YgyptOPā€¢3w ago
I'm just going to wait for hikari because I've spent the last hour for one meaningful step, which I do appreciate, but all that jumping around in the terminal was for information I already had on-hand
CheckYourFax
CheckYourFaxā€¢3w ago
Sorry for that. I was under the assumption you needed to add the NVMe drive to the VFIO driver. It might still be needed, so the information is not entirely useless. The issue here is likely SELinux as well as the other user (see: https://discord.com/channels/1072614816579063828/1326992075740155976) and I can't really help you with that. I have zero experience in messing with SELinux. The issue you're having right now has nothing to do with booting your Windows drive directly, but a more general QEMU problem, so I've been led on a red herring. šŸ˜›
Ygypt
YgyptOPā€¢3w ago
Well no I did need these instructions so I appreciate that, but yeah right now my roadblock is the fact that virt-manager is refusing to create machines
CheckYourFax
CheckYourFaxā€¢3w ago
Hikari also has more experience in passing through PCI devices, so if it doesn't work after this issue is resolved, he'll be able to help you a lot quicker than I can
HikariKnight
HikariKnightā€¢3w ago
ls-iommu --help soooo much better
Ygypt
YgyptOPā€¢3w ago
https://github.com/winapps-org/winapps/blob/main/docs/libvirt.md this has information specifically regarding bazzite which is cool (yes my end goal is to also export the apps) ill report back if this works
GitHub
winapps/docs/libvirt.md at main Ā· winapps-org/winapps
Run Windows apps such as Microsoft Office/Adobe in Linux (Ubuntu/Fedora) and GNOME/KDE as if they were a part of the native OS, including Nautilus integration. Hard fork of https://github.com/Fmst...
Ygypt
YgyptOPā€¢3w ago
it suggests adding the user to the group kvm which ujust setup-virtulization does not do
HikariKnight
HikariKnightā€¢3w ago
This is such a much worse experience than just GPU passthrough if you have a 2nd gpu
Ygypt
YgyptOPā€¢3w ago
And if I have a single GPU..?
CheckYourFax
CheckYourFaxā€¢3w ago
what are your specs? because in some cases you can pass the iGPU just fine
Ygypt
YgyptOPā€¢3w ago
Your sentence is a little nebulous, are you suggesting it's easier or harder with a second gpu
CheckYourFax
CheckYourFaxā€¢3w ago
easier, because you'll have full DirectDraw GPU acceleration its going to be a million times smoother
Ygypt
YgyptOPā€¢3w ago
right on well i only have one so thats out of the question
CheckYourFax
CheckYourFaxā€¢3w ago
Your CPU has no integrated GPU?
Ygypt
YgyptOPā€¢3w ago
no
CheckYourFax
CheckYourFaxā€¢3w ago
okay that is out of the question
HikariKnight
HikariKnightā€¢3w ago
Well don't expect any hardware acceleration then
CheckYourFax
CheckYourFaxā€¢3w ago
but the issue right now is that you can't create a VM at all because of SELinux probably
Ygypt
YgyptOPā€¢3w ago
cant hardware accelerate with a single gpu? does the vm need total control
HikariKnight
HikariKnightā€¢3w ago
We will just focus on the SSD and fixing the log as selinux messed that up
Ygypt
YgyptOPā€¢3w ago
its only going to be for ms office anyways, if i wanted graphics id just reboot into windows
HikariKnight
HikariKnightā€¢3w ago
We do not support single GPU passthrough because it's a pain in the ass that needs to be specifically tuned to your environment and system. Plus it will kill your Linux login session and applications and once you return you get back to the login Not worth us supporting
Ygypt
YgyptOPā€¢3w ago
right on no biggie
CheckYourFax
CheckYourFaxā€¢3w ago
@HikariKnight so easier to just dual boot at that point šŸ˜‚
Ygypt
YgyptOPā€¢3w ago
right like i said if i need any real performance ill just reboot
HikariKnight
HikariKnightā€¢3w ago
Ok so if you're going to be using VM and rebooting to windows you will mess up your license for windows super quick, so much so you will be denied from fixing it @Kyle Gospo wanna do the honors?
Kyle Gospo
Kyle Gospoā€¢3w ago
Reminder: no piracy discussions See you in a week Next one is permanent
HikariKnight
HikariKnightā€¢3w ago
NOTE: do not help Ygypt with using virtualization for his windows install anyways @CheckYourFax did you look at our ls-iommu?
CheckYourFax
CheckYourFaxā€¢3w ago
Yes. It's a million times better
HikariKnight
HikariKnightā€¢3w ago
thank you, the bash script (which i hated) was an inspiration for it i wish i knew how to make the argument handling better though so i didnt have to write (works with xyz) on many of them
CheckYourFax
CheckYourFaxā€¢3w ago
I had a question: DO you NEED to add an NVMe to VFIO for it to be passed to the VM?
HikariKnight
HikariKnightā€¢3w ago
you can just pass the whole block device as a raw image and that will work fine as long as you dont have it mounted on the host ever when the VM is running
CheckYourFax
CheckYourFaxā€¢3w ago
I suppose you could do it through a virtual SATA bus but I feel like that would be incredibly slow Yes that makes sense. Otherwise its instant corruption
HikariKnight
HikariKnightā€¢3w ago
install virtio driver, add dummy disk and set it to virtio to kickstart the driver switch to virtio block bus or virtio-scsi then remove dummy disk
CheckYourFax
CheckYourFaxā€¢3w ago
no virtio required if you do it the IOMMU way right?
HikariKnight
HikariKnightā€¢3w ago
true
CheckYourFax
CheckYourFaxā€¢3w ago
and pass the actual device
HikariKnight
HikariKnightā€¢3w ago
but its a bit of a taller ask since now youre asking for the gpu AND nvme to be alone in iommu groups
CheckYourFax
CheckYourFaxā€¢3w ago
but it IS possible? Because if it is I want to try it on my arch desktop
HikariKnight
HikariKnightā€¢3w ago
in theory it should, its just a pcie device why you think i got the nvme option in ls-iommu šŸ˜‚
HikariKnight
HikariKnightā€¢3w ago
GitHub
GitHub - HikariKnight/ls-iommu: A tool to list devices in iommu gro...
A tool to list devices in iommu groups, useful for setting up VFIO - HikariKnight/ls-iommu
CheckYourFax
CheckYourFaxā€¢3w ago
you made this whole thing? damn this is insane
HikariKnight
HikariKnightā€¢3w ago
look at that, so much better than that silly little bash script people use šŸ˜…
No description
HikariKnight
HikariKnightā€¢3w ago
also unlike the bash script, the iommu groups are SORTED like actually sorted
CheckYourFax
CheckYourFaxā€¢3w ago
technically you could put the NVMe and the GPU in the same iommu group and pass it through at the same time? How feasible is this? Oh wait you got the problem with them both needing to already be in the same group
HikariKnight
HikariKnightā€¢3w ago
you dont contol the iommu groups at best you can use the hacky ACS patch and pray it separates them better (we have it included, until people run into issues caused by it)
HikariKnight
HikariKnightā€¢3w ago
look at this though šŸ˜›
No description
HikariKnight
HikariKnightā€¢3w ago
need to grab something you need for the passthrough, it will grab the crap you need šŸ˜„
HikariKnight
HikariKnightā€¢3w ago
No description
HikariKnight
HikariKnightā€¢3w ago
and yes i made the whole thing, damn proud of it too. had some help from my friend in australia when i was stuck as it was my "teach myself golang" project
CheckYourFax
CheckYourFaxā€¢3w ago
yeah but if you have two devices that are exactly the same model, that can be annoying. A quick way of seeing which device is on which /dev/ mount point would be nice what is the easiest way? that you can compare with the IOMMU lists just so its easier to help someone in the future
HikariKnight
HikariKnightā€¢3w ago
if you have 2 gpus like that, youre cooked here on atomic since it would require you to add a custom script to initramfs, cant do that without a custom image going forward for nvmes just passing the block device (the whole device one, not one of the partitions) is enough and make sure you never mount it when the vm is running and that its not mounted when the vm is running
CheckYourFax
CheckYourFaxā€¢3w ago
Okay, that makes sense. And then you just do RAW while making VM and choose the disk right? or no storage device whatsoever?
HikariKnight
HikariKnightā€¢3w ago
yup
CheckYourFax
CheckYourFaxā€¢3w ago
Okay. Awesome.
HikariKnight
HikariKnightā€¢3w ago
raw = just like a device block its the same thing you get if you dd a disk into a file
CheckYourFax
CheckYourFaxā€¢3w ago
that way you would still need the VirtIO driver for better performance right?
HikariKnight
HikariKnightā€¢3w ago
yes its not perfect but you will get at least with gen3 drives in my experience like 80-90% of the performance 2 sec let me just fire up crystaldiskmark on my vm just to doublecheck but its certainly playable
CheckYourFax
CheckYourFaxā€¢3w ago
I definitely want to try passing through the NVMe (a 960 evo) together with the GTX 1080 on my arch desktop. It's a 6600K with VT-d enabled. The IOMMU groups are on this platform not ideal so it might just not be possible on newer platforms seems like its way easier to get it done because almost everything has its own group
HikariKnight
HikariKnightā€¢3w ago
not always asrock is still best in class when it comes to passthrough support
CheckYourFax
CheckYourFaxā€¢3w ago
This is good to know. Thanks. do you know which models are usually best?
HikariKnight
HikariKnightā€¢3w ago
the fact that asrock is owned by acer is kinda funny though considering acer is a mixed bag when it comes to laptops and desktops šŸ˜… on the amd side all the X chipsets you might get the firmware ACS patch in B chipsets from them but often they do not have space to include it there last i talked to someone from asrock
CheckYourFax
CheckYourFaxā€¢3w ago
oh they have ACS patches from themselves? That's some customer support right there
HikariKnight
HikariKnightā€¢3w ago
No description
CheckYourFax
CheckYourFaxā€¢3w ago
that's not horrible random 4k write is kinda oof but its enough to be snappy
HikariKnight
HikariKnightā€¢3w ago
keep in mind this is a crappy nvme i aquired from a laptop that got run over by a tractor
CheckYourFax
CheckYourFaxā€¢3w ago
a laptop that got run over by a tractor? like literally? :huh:
HikariKnight
HikariKnightā€¢3w ago
yes its a miracle its still straight
CheckYourFax
CheckYourFaxā€¢3w ago
well the current ujust for setup-virtualization is not perfect first thing you're greeted with after reboot is that the daemon is not running
HikariKnight
HikariKnightā€¢3w ago
the one that i had to bend out from a hp laptop where the ssd screw came factory stripped is more bent
CheckYourFax
CheckYourFaxā€¢3w ago
:dispair:
HikariKnight
HikariKnightā€¢3w ago
there is literally a service that should fix this....
CheckYourFax
CheckYourFaxā€¢3w ago
is that not in the script by default?
HikariKnight
HikariKnightā€¢3w ago
and keep it on when you upgrade between fedora versions script enables it part of enable virtualization
CheckYourFax
CheckYourFaxā€¢3w ago
not any of the other settings right? so far ive only done enable virtualization on my lgo i just wanna test the problems people are having, and this is a device where ive never enabled it yet
HikariKnight
HikariKnightā€¢3w ago
nope enable virtualization enables a service that makes sure libvirt stays enabled after fedora releases
CheckYourFax
CheckYourFaxā€¢3w ago
bazzite-libvirtd-setup.service this one
HikariKnight
HikariKnightā€¢3w ago
yep
CheckYourFax
CheckYourFaxā€¢3w ago
when i re-execute the script it says symlinks it and then "libvirtd will be enabled at next reboot"
HikariKnight
HikariKnightā€¢3w ago
yep
CheckYourFax
CheckYourFaxā€¢3w ago
let me check journald something ain't right
HikariKnight
HikariKnightā€¢3w ago
it checks if libvirtd is running, if it isnt it enables the service
CheckYourFax
CheckYourFaxā€¢3w ago
yeah its not starting on boot after reboot for some reason on bazzite-deck
HikariKnight
HikariKnightā€¢3w ago
it disables itself after its done it was our way to enable libvirtd when you had to layer everything thats why we made it so we could enable libvirt without having to do the awkward ok its installed but not enabled, reboot and rerun this step
CheckYourFax
CheckYourFaxā€¢3w ago
when you only enable virtualization there's no extra kargs right? or should there be?
HikariKnight
HikariKnightā€¢3w ago
nope oh wait nvm there is 2
CheckYourFax
CheckYourFaxā€¢3w ago
these should show on rpm-ostree? status
HikariKnight
HikariKnightā€¢3w ago
stop win10 from bluescreening by disabling msr or whatever its called and then disable logging that it ignored the signal (so your journal and dmesg isnt spammed)
CheckYourFax
CheckYourFaxā€¢3w ago
yeah no it did do some kargs as it was staging deployment
HikariKnight
HikariKnightā€¢3w ago
kvm.ignore_msrs=1 kvm.report_ignored_msrs=0 these to it does first one prevents windows10 (and newer) vms from bluescreening when they do msrs calls 2nd one tells the kernel to not report ignored msrs calls since it will spam like 4-5 every second almost
CheckYourFax
CheckYourFaxā€¢3w ago
something isn't right the libvirtd service is running but virtmanager detects nothing wait let me post logs why it worked fine in the old method and doesn't now is weird
HikariKnight
HikariKnightā€¢3w ago
works for everyone else šŸ¤·
CheckYourFax
CheckYourFaxā€¢3w ago
ā—‹ libvirtd.service - libvirt legacy monolithic daemon Loaded: loaded (/usr/lib/systemd/system/libvirtd.service; enabled; preset: disabled) Drop-In: /usr/lib/systemd/system/service.d ā””ā”€10-timeout-abort.conf, 50-keep-warm.conf Active: inactive (dead) since Sun 2025-01-12 03:33:00 CET; 1min 37s ago Duration: 2min 93ms Invocation: 8f6f0938bbc34c1287c648a651b9bb24 TriggeredBy: ā— libvirtd.socket ā— libvirtd-ro.socket ā— libvirtd-admin.socket Docs: man:libvirtd(8) https://libvirt.org/ Process: 3093 ExecStart=/usr/sbin/libvirtd $LIBVIRTD_ARGS (code=exited, status=0/SUCCESS) Main PID: 3093 (code=exited, status=0/SUCCESS) Tasks: 2 (limit: 32768) Memory: 48.5M (peak: 66.5M) CPU: 731ms CGroup: /system.slice/libvirtd.service ā”œā”€3281 /usr/sbin/dnsmasq --conf-file=/var/lib/libvirt/dnsmasq/default.conf --leasefile-ro --dhcp-> ā””ā”€3283 /usr/sbin/dnsmasq --conf-file=/var/lib/libvirt/dnsmasq/default.conf --leasefile-ro --dhcp-> Jan 12 03:31:01 legiongo dnsmasq-dhcp[3281]: DHCP, sockets bound exclusively to interface virbr0 Jan 12 03:31:01 legiongo dnsmasq[3281]: reading /etc/resolv.conf Jan 12 03:31:01 legiongo dnsmasq[3281]: using nameserver 127.0.0.53#53 Jan 12 03:31:01 legiongo dnsmasq[3281]: read /etc/hosts - 8 names Jan 12 03:31:01 legiongo dnsmasq[3281]: read /var/lib/libvirt/dnsmasq/default.addnhosts - 0 names Jan 12 03:31:01 legiongo dnsmasq-dhcp[3281]: read /var/lib/libvirt/dnsmasq/default.hostsfile Jan 12 03:33:00 legiongo systemd[1]: libvirtd.service: Deactivated successfully. Jan 12 03:33:00 legiongo systemd[1]: libvirtd.service: Unit process 3281 (dnsmasq) remains running after unit > Jan 12 03:33:00 legiongo systemd[1]: libvirtd.service: Unit process 3283 (dnsmasq) remains running after unit > Jan 12 03:33:00 legiongo systemd[1]: libvirtd.service: Consumed 731ms CPU time, 66.5M memory peak.
libvirt: The virtualization API
libvirt, virtualization, virtualization API
CheckYourFax
CheckYourFaxā€¢3w ago
No description
CheckYourFax
CheckYourFaxā€¢3w ago
Ah yeah no I forgot you have to manually add the connection
CheckYourFax
CheckYourFaxā€¢3w ago
I think I know the issue people are having they're installing all the stuff without knowing what they're doing Yeah now I'm having the same issue with no access to home folder. Unable to complete install: 'internal error: process exited while connecting to monitor: 2025-01-12T02:43:28.476438Z qemu-system-x86_64: -blockdev {"driver":"file","filename":"/var/home/bazzite/Downloads/en-us_windows_11_consumer_editions_version_23h2_updated_dec_2024_x64_dvd_2e075bad.iso","node-name":"libvirt-1-storage","read-only":true}: Could not open '/var/home/bazzite/Downloads/en-us_windows_11_consumer_editions_version_23h2_updated_dec_2024_x64_dvd_2e075bad.iso': Permission denied' Traceback (most recent call last): File "/app/share/virt-manager/virtManager/asyncjob.py", line 71, in cb_wrapper callback(asyncjob, *args, **kwargs) File "/app/share/virt-manager/virtManager/createvm.py", line 2008, in _do_async_install installer.start_install(guest, meter=meter) File "/app/share/virt-manager/virtinst/install/installer.py", line 726, in start_install domain = self._create_guest( ^^^^^^^^^^^^^^^^^^^ File "/app/share/virt-manager/virtinst/install/installer.py", line 667, in _create_guest domain = self.conn.createXML(initial_xml or final_xml, 0) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/app/lib/python3.12/site-packages/libvirt.py", line 4545, in createXML raise libvirtError('virDomainCreateXML() failed') libvirt.libvirtError: internal error: process exited while connecting to monitor: 2025-01-12T02:43:28.476438Z qemu-system-x86_64: -blockdev {"driver":"file","filename":"/var/home/bazzite/Downloads/en-us_windows_11_consumer_editions_version_23h2_updated_dec_2024_x64_dvd_2e075bad.iso","node-name":"libvirt-1-storage","read-only":true}: Could not open '/var/home/bazzite/Downloads/en-us_windows_11_consumer_editions_version_23h2_updated_dec_2024_x64_dvd_2e075bad.iso': Permission denied
HikariKnight
HikariKnightā€¢3w ago
sudo setfacl -m u:qemu:rx $HOME
CheckYourFax
CheckYourFaxā€¢3w ago
Unable to complete install: 'internal error: Could not run '/usr/bin/swtpm_setup'. exitstatus: 1; Check error log '/var/log/swtpm/libvirt/qemu/win11-swtpm.log' for details.' There we go, the TPM problem
HikariKnight
HikariKnightā€¢3w ago
does /var/lib/swtpm-localca exist? if it does then send me the log it made
CheckYourFax
CheckYourFaxā€¢3w ago
yes sec swtpm at /usr/bin/swtpm does not support TPM 2 That's a big F with passthrough I get this: Unable to complete install: 'internal error: QEMU unexpectedly closed the monitor (vm='win11'): 2025-01-12T02:55:09.125756Z qemu-system-x86_64: Requested buffer size of 3968 is smaller than host TPM's fixed buffer size of 4096'
HikariKnight
HikariKnightā€¢3w ago
just added it emulated, works for me????
CheckYourFax
CheckYourFaxā€¢3w ago
Fedora Discussion
TPM Does Not Work Virt-Manager Fedora 40
I confirm the issue in system mode, but it works fine for me in session mode: virt-manager -c qemu:///session qemu:///system vs qemu:///session | Cole Robinson Update: Unable to create new virt-manager vm with software TPM on Fedora 40 - #48 by vgaetera
CheckYourFax
CheckYourFaxā€¢3w ago
this is an issue with SELinux are we using an older version of swtpm package?
HikariKnight
HikariKnightā€¢3w ago
i dont have any selinux rules for swtpm that i made though šŸ¤”
CheckYourFax
CheckYourFaxā€¢3w ago
its because it has to do with newly installed systems whens the last time you reinstalled?
HikariKnight
HikariKnightā€¢3w ago
2023 šŸ¤£
CheckYourFax
CheckYourFaxā€¢3w ago
that explains it šŸ˜›
HikariKnight
HikariKnightā€¢3w ago
new bugs are fun
CheckYourFax
CheckYourFaxā€¢3w ago
theres an issue creating selinux rules with swtpm-selinux so i need to somehow manually fix this?
CheckYourFax
CheckYourFaxā€¢3w ago
Maybe unstable fixes the issue?
No description
CheckYourFax
CheckYourFaxā€¢3w ago
who knows?
HikariKnight
HikariKnightā€¢3w ago
no idea šŸ¤” dont really have the possibility to reinstall constantly here
CheckYourFax
CheckYourFaxā€¢3w ago
I'm getting insanely high amounts of sealerts when i try to make the VM so it is SELinux
HikariKnight
HikariKnightā€¢3w ago
fuuuun do you know what is complaining you can make manual rules fairly easy
CheckYourFax
CheckYourFaxā€¢3w ago
rpc-virtqemud its multiple things let me dig through
HikariKnight
HikariKnightā€¢3w ago
sudo grep libvirt /var/log/audit/audit.log | audit2allow -M my-libvirt
sudo semodule -i my-libvirt.pp
sudo grep libvirt /var/log/audit/audit.log | audit2allow -M my-libvirt
sudo semodule -i my-libvirt.pp
just adjust that and you can make modules with rules for each
CheckYourFax
CheckYourFaxā€¢3w ago
semodule
HikariKnight
HikariKnightā€¢3w ago
sorry its late šŸ˜…
CheckYourFax
CheckYourFaxā€¢3w ago
no sealerts anymore but still the same tpm error F back to digging that fedora forum type=AVC msg=audit(01/12/2025 04:19:30.579:1179) : avc: denied { execute } for pid=15067 comm=rpc-virtqemud name=qemu dev="nvme0n1p3" ino=476259 scontext=system_u:system_r:virtqemud_t:s0 tcontext=unconfined_u:object_r:virt_etc_t:s0 tclass=file permissive=1 ---- type=AVC msg=audit(01/12/2025 04:19:30.595:1182) : avc: denied { relabelfrom } for pid=15069 comm=rpc-virtqemud name=domain-3-win11 dev="nvme0n1p3" ino=328223 scontext=system_u:system_r:virtqemud_t:s0 tcontext=system_u:object_r:var_lib_t:s0 tclass=dir permissive=1 ---- type=AVC msg=audit(01/12/2025 04:19:30.639:1183) : avc: denied { remove_name } for pid=10426 comm=rpc-virtqemud name=domain-3-win11 dev="nvme0n1p3" ino=328223 scontext=system_u:system_r:virtqemud_t:s0 tcontext=system_u:object_r:var_lib_t:s0 tclass=dir permissive=1 ---- type=AVC msg=audit(01/12/2025 04:19:33.258:1194) : avc: denied { execute } for pid=15111 comm=rpm name=rpm-ostree dev="nvme0n1p3" ino=176158 scontext=system_u:system_r:setroubleshootd_t:s0 tcontext=system_u:object_r:install_exec_t:s0 tclass=file permissive=0 ---- type=AVC msg=audit(01/12/2025 04:19:33.258:1195) : avc: denied { execute } for pid=15111 comm=rpm name=rpm-ostree dev="nvme0n1p3" ino=176158 scontext=system_u:system_r:setroubleshootd_t:s0 tcontext=system_u:object_r:install_exec_t:s0 tclass=file permissive=0 ---- type=AVC msg=audit(01/12/2025 04:19:33.258:1196) : avc: denied { execute } for pid=15111 comm=rpm name=rpm-ostree dev="nvme0n1p3" ino=176158 scontext=system_u:system_r:setroubleshootd_t:s0 tcontext=system_u:object_r:install_exec_t:s0 tclass=file permissive=0 Getting this when making VM swtpm at /usr/bin/swtpm does not support TPM 2 swtpm at /usr/bin/swtpm does not support TPM 2 swtpm at /usr/bin/swtpm does not support TPM 2 swtpm at /usr/bin/swtpm does not support TPM 2 swtpm at /usr/bin/swtpm does not support TPM 2 swtpm at /usr/bin/swtpm does not support TPM 2 I still get this Workaround for now: Remove TPM from hardware->BypassTPM in setup. through a regedit
HikariKnight
HikariKnightā€¢3w ago
only thing i can found is a proxmox post where libtpms was broken and you had to remove it to fix swtpm with tpm2 but that was 2023 and proxmox is debian based :clueless:
CheckYourFax
CheckYourFaxā€¢3w ago
I can find some topics about swtpm on Fedora project forums, but they have all been fixed waaay before f41 was out but its all selinux and these selinux things have been fixed now no more alerts so its not selinux
HikariKnight
HikariKnightā€¢3w ago
im at a loss and sleepy xD
CheckYourFax
CheckYourFaxā€¢3w ago
No description
CheckYourFax
CheckYourFaxā€¢3w ago
this is all the journald stuff that shows after trying to make it No worries. Have a good night o7 So i tried making a TPM cert myself manually using swtpm_setup and that generates a more specific error the problem is swptpm_localca Okay never mind I forgot sudo it works fine if done with sudo
HikariKnight
HikariKnightā€¢3w ago
have you done anything like running vms as the qemu user session or changed the VM user to not be qemu? only other thing i can think of
CheckYourFax
CheckYourFaxā€¢3w ago
What I honestly think the problem is is that when swtpm_setup is executed by virt-manager, it is not using the --tpm2 argument or it IS an access issue with swtpm_localca
HikariKnight
HikariKnightā€¢3w ago
thats why i asked if you had modified what user that libvirt uses for vms since someone did that change to make "i want to use iso from home to work šŸ˜­ "
CheckYourFax
CheckYourFaxā€¢3w ago
nope also swtpm is ran as tss:tss not qemu
HikariKnight
HikariKnightā€¢3w ago
yeah i was just thinking on some weird interaction where "no your user is not allowed to run swtpm_setup in this context it is only allowed for X" kind of how apparmor works in some situations iirc
CheckYourFax
CheckYourFaxā€¢3w ago
It's not an issue of TPM version Tried creating a TPM 1.2 device and now it gives "does not support TPM 1.2" whole swtpm is broken
HikariKnight
HikariKnightā€¢3w ago
šŸ˜­ hmm i wonder layer virt-manager see if its a flatpak issue if you never had virt-manager layered i doubt its related but worth checking i guess
CheckYourFax
CheckYourFaxā€¢3w ago
drwxr-xr-x. 1 tss tss 230 Jan 12 03:43 . drwxr-xr-x. 1 root root 812 Jan 12 02:39 .. -rw-r--r--. 1 tss tss 20 Jan 12 04:57 certserial -rw-r--r--. 1 tss tss 1505 Jan 12 03:43 issuercert.pem -rwxr-xr-x. 1 tss tss 0 Jan 12 03:43 .lock.swtpm-localca -rw-r-----. 1 tss tss 8170 Jan 12 03:43 signkey.pem -rw-r--r--. 1 tss tss 1468 Jan 12 03:43 swtpm-localca-rootca-cert.pem -rw-r-----. 1 tss tss 8177 Jan 12 03:43 swtpm-localca-rootca-privkey.pem this correct right? I'm gonna try layer Nope, doesn't work
HikariKnight
HikariKnightā€¢3w ago
all correct well darn, was worth a shot
CheckYourFax
CheckYourFaxā€¢3w ago
setting SELinux to permissive fixed it so its 100% SELinux sudo setenforce 0 but why there's not a more specific alert is strange How do I figure out what part of SELinux is causing the issue?
HikariKnight
HikariKnightā€¢3w ago
hmm
CheckYourFax
CheckYourFaxā€¢3w ago
the moment i put sudo setenforce 1 it breaks again
HikariKnight
HikariKnightā€¢3w ago
sudo restorecon -R /var/blah/whatever just dont run it on / as it wont work maybe its needed for the dumb swtpm folder
CheckYourFax
CheckYourFaxā€¢3w ago
I don't know where the path would be It doesn't tell you
HikariKnight
HikariKnightā€¢3w ago
the localca directory for swtpm i would guess im more baffled it doesnt make selinux log entries
CheckYourFax
CheckYourFaxā€¢3w ago
there is one when i manually did an sealert -a on the audit.log recent one
HikariKnight
HikariKnightā€¢3w ago
is it any useful
CheckYourFax
CheckYourFaxā€¢3w ago
had to do with qemu at least but only "relabel" on the virtual hard disk didn't seem too useful
HikariKnight
HikariKnightā€¢3w ago
oh well im going back to bed
CheckYourFax
CheckYourFaxā€¢3w ago
alright man, im going to continue the search good night Tried all of this. Nothing works except making SELinux permissive I'm done going down this rabbit hole for now: Just make VM and then set SELinux back to enforcing ĀÆ\_(惄)_/ĀÆ once the TPM is created there's no issue
Ygypt
YgyptOPā€¢2w ago
yo im back so my solution was to scrap the whole idea and just did winapps thru podman, all the stuff im working on is in a cloud account anyways. i DID get virt-manager to work on a fresh iso by enabling tpm passthrough, i think i had to change the dropdown (to default iirc) incase anyones still struggling with virt-manager. my honest reccomendation tho is to use podman it Just Works

Did you find this page helpful?