removable hardware shown in guest windows VM can be ejected

dartface

Cadet
Joined
Jun 28, 2022
Messages
5
Is it possible to have the virtualization KVM not pass through the virtual devices to a guest VM as removable?
I know this is something you can change with VMs in VMware with windows guest VMs. This is a problem if a user of the guest windows VM decides to eject a device that they shouldn't.
Screenshot from 2023-11-27 21-11-21.png
 

dartface

Cadet
Joined
Jun 28, 2022
Messages
5
Sorry I should say I'm working with a Windows server 2022 guest VM that I have downloaded and installed the Windows VirtIO Drivers
 

jgreco

Resident Grinch
Joined
May 29, 2011
Messages
18,680
Devices supported by the virtIO drivers are typically classified as hotplug capable; the typical fix is to twiddle this off (in the xml or whatever). I don't have a handy link but a quick Google with some well-guessed terms turned up the following discussion which may be relevant:


I believe that there is also a way to disable this on the Windows side of things.
 

dartface

Cadet
Joined
Jun 28, 2022
Messages
5
Devices supported by the virtIO drivers are typically classified as hotplug capable; the typical fix is to twiddle this off (in the xml or whatever). I don't have a handy link but a quick Google with some well-guessed terms turned up the following discussion which may be relevant:


I believe that there is also a way to disable this on the Windows side of things.
Well can this just made default with windows based vms? Where do I request that?
 

dartface

Cadet
Joined
Jun 28, 2022
Messages
5
It could be, at the price of screwing over all the people who rely on this behaviour.
Okay specifically, thinking an improvement could be to have a tick box in the virtualization GUI for each device to be able to set that hotplug setting. I can't imagine people rely on being able to eject a network card or whatever those other devices are in my screenshot, they are not hotplug removable in real physical scenarios so why would that ever be needed? a disk maybe but having them all set to hotplug off by default makes more sense.
where would I request a feature/change? is this thread enough?
Also been googling and can't find where i set the hotplug setting for the TNS VMs, and if i could it also looks like i shouldn't as the setting might not survive a TNS reboot.
 

jgreco

Resident Grinch
Joined
May 29, 2011
Messages
18,680
I can't imagine people rely on being able to eject a network card or whatever those other devices are in my screenshot, they are not hotplug removable in real physical scenarios so why would that ever be needed?

You're incorrect, you just may not have thought it through. Even in a physical host scenario, devices such as network connections and storage are routinely hooked up to physical hosts -- just look at any USB thumb drive, USB ethernet dongle, Thunderbolt accessories, etc. It may be true that you cannot hot detach your mainboard's onboard ethernet because it is soldered on, but certainly the capability to create hot plug devices exists -- see for ex.

Ethernet Adapters and Devices User Guide

Sep 3, 2020 — Most Intel® Ethernet Server Adapters are enabled for use in selected servers equipped with Hot Plug support.


Hot adding and removal of disks, network, memory, and even CPU's is quite possible and often used to adjust the configuration of virtual machines. If you can picture the need to add any of these resources to a virtual machine while it is shut down, the question then becomes "and why do you need to shut it down for that to be possible?"

Since the virtIO devices are inherently a figment of the server's imagination, there's no reason that they cannot be hot added or removed. There may be administrative reasons you want these to remain available, so one option would be to disable Windows hot removal. I don't have a link handy since I haven't looked at this in many years.
 

dartface

Cadet
Joined
Jun 28, 2022
Messages
5
I'm bet that capability was required by large datacentres where they need many 9s of uptime for SLAs. This is not a feature designed for SMBs or home use cases.
I suggest leaving the setting as is for default but having a tick box in the UI for disabling this so that the people on the other side of this issue who dont want to be able to disable important hardware devices that easily.
I'm not sure it's able to be done by a standard user but imagine a terminal server where you have many standard privileged users that could remove the servers network adapters because they are playing around and not considering the consequences of clicking these sort of options
 
Top