Which Hypervisors allow Raw PCI access? - hardware

I am trying to find out which Hypervisor will allow me to grant access to specialized PCI cards (such as a telephony card) to a virtual machine. So far I have tried out VMWare ESXi server and it doesn't seem to allow me to do this. I have heard that Microsoft Virtual Server does allow this, but I haven't been able to find any supporting documentation.

I'd look into Xen, it appears that you can load a backend xen driver on the host OS which will then allow you to communicate directly with the hardware from the guest.
See this link for more information. I'm not a Xen user, but from my virtualization experience I would guess that the paravirtualization aspects of a Xen host/guess is going to be your best bet for raw device access.

Yes, Xen can do this successfully. It is called PCI Passthrough: http://wiki.xen.org/wiki/Xen_PCI_Passthrough
I've done this successfully for both Windows and Linux guests with Xen 4.x, using my system's IOMMU. There are some restrictions on which devices can be assigned to which guests based on the PCI hierarchy in your particular system. You can view yours in Linux using 'lspci -t' (for "tree").
The IOMMU is located fairly high up in the tree, so on laptop-like systems, there may not be much partitioning available. Add-in PCIe cards can almost always be assigned, though.

Related

Multiple VMs Accessing a single device over PCIE

I am using the libvirt/QEMU/KVM stack to run some VMs on an Ubuntu 20.04 host. I am using the virsh CLI tool for VM management. I'd like to allow multiple VMs to access the same device (FPGA) over PCIE. It seems that libvirt doesn't allow this, and when I attach the PCIE device to multiple VMs and try to power more than one on, I get the following error.
error: Failed to start domain ubuntu-guest-2
error: Requested operation is not valid: PCI device 0000:05:00.0 is in use by driver QEMU, domain ubuntu-guest-1
This kinda makes sense to me, as there shouldn't be conflicting data sent over the PCIE bus. But nonetheless, does anyone know a workaround to make this happen?
There are a number of techniques to share a device across VMs. All of them require either device-specific software support in the VMM, hardware in the device to support sharing (SR-IOV), or both (Scalable IOV).
For a custom FPGA design, you would need to provide this.
SR-IOV is part of the PCIe specification, so there may be libraries available that you could incorporate into your FPGA design.

Is it possible to have different dev VM environments and access graphics card?

What I want to do on my laptop:
Develop and Run on windows with Visual Studio (CUDA, TensorRT,...)
Develop and Run on Linux (CUDA, TensorRT,...)
Environment to edit videos, photoshop,...
Play games
Environment for general use (web browser, outlook, word,...)
Environment to test applications
Possibly connecting some external GPU to offload the work (cuda,...) from my laptop's graphics card. Since I'm new to this, I haven't researched enough to understand how it can be done. But, this is in my plans.
What I did and reaserched:
As a start, I created VM environements in my host Windows OS using VirtualBox for #1 and #2, but I cannot run inside VM, since it doesn't provide access to graphics card. Even if it did, I still need somehow to switch to a different environment when I want to play games for example.
I probably need hypervisor type 1 if I want to have environment to play games? But, in this case I'll need a second laptop to access it, right?
Is this even possible to do on one laptop (I have strong laptop with enough RAM and SSD)
Graphics cards (GPU) are PCI devices, so they can be passed to VMs with PCI Passthrough. A device is not accessible to the host during passthrough. Hot plug can be used to reattach a graphics card to a different VM or the host without rebooting.
I don't know if a Windows host supports GPU passthrough (maybe you need Windows Server), but Linux host and Windows guest seems to work.
Setting this up is easier if you have a second GPU that remains attached to the host or another computer to control the host during GPU passthrough, for example via SSH.

Is it possible to monitor SMART disk information from a VM?

I am working on a server ubuntu 14.04.1 LTS
In fact i don't have an access to the server itself, but at a VM.
I am trying to monitor SMART disk information (like Temperature_Celsius and othet stuff like that) but only from the VM.
I think it is impossible because the VM havent any real access to the physical server, but I am not sure of it.
Thank you for read and i hope someone could answer me fast.
It will work provided that the VM "owns" the disk and the virtualisation engine permits arbitrary commands to be sent to the disk. In the mass-hosting case where multiple virtual machines are sharing a disk, that's a no-go, but it can be viable for custom configurations.
For example, you can use VMWare to pass-through a USB-SATA converter to the guest. Provided the guest supports sending SMART commands to USB Mass Storage devices — and anything you're likely to run in 2014 will have this support — you're good.

Need to make USB drive skip itself in boot order without changing bios

I know how to change boot order through bios settings, but I have a unique situation where doing it programatically would be better. The company I work for sells and supports software remotely to thousands of non tech savvy customers. We can't touch their hardware settings, we are only the software vendor.
Recently we rolled out a option for their PCI compliancy that requires a separate removable drive to store a private encryption key. Customers that use this option have to leave a usb drive with a .dat file containing the RSA key at all times. Currently this presents an issue when customers reboot. Sometimes we can walk them through over the phone how to change their bios settings to skip the USB drive, but in many circumstances we cannot, because of the caller and the other end of the phone not being tech savvy enough to change bios settings, and different PC's having different BIOS setups.
So my question is, is there any kind of ini file I can create or boot record on the disk itself than can be added or changed to cause the system to see that there is no OS on the USB, keep going down the list of boot drives. Instead, with no OS many PC's hang on Missing OS screen until we have customer remove drive reboot and plug back in after Windows starts to load. All PC's are Windows, all XP or newer.
You're talking about manipulating BIOS Setup data. Unfortunately there is no industry-standard for computers to manipulate Setup fields, like the boot sequence, so any solution is likely to be vendor-specific.
An example: Dell Inc. provides customers OpenManage Client Instrumentation (OMCI) that allows admins to remotely change settings, like boot sequence, via standard interfaces like CIM/WMI. See this whitepaper:
http://www.dell.com/downloads/global/solutions/omci_info.pdf
Especially:
OMCI is the Dell instrumentation package that enables OptiPlex™, Dell
Precision™, and Latitude™ systems to be managed remotely. OMCI
contains the underlying driver set that collects system information
from a number of different sources on the client computer, including
the BIOS, CMOS, System Management BIOS (SMBIOS), System Management
Interface (SMI), operating system, APIs, DLLs, and registry settings.
OMCI exposes that information through the CIMOM interface of the WMI
stack. Thus, OMCI enables IT administrators to remotely collect asset
information, modify CMOS settings, ...
OMCI is specific to the Dell BIOS, so it won't work with other vendors' machines. Other enterprise hardware vendors (e.g. HP, IBM) provide similar software. If you can live with a vendor-specific solution, this may work for you.
May I ask if your USB is actually non-bootable?
How did you format it? FAT32, NTFS etc?
Why can't Windows bypass this usb when booting normally when (i assume) it is not bootable. Normally my system boots to Windows OS even if there is a non-bootable usb plugged in.
BTW have you tried keeping the DAT file on usb as hidden, read only, it's worth a try.

PCI Express driver for embedded system

We are developing an embedded system which will use a PC motherboard running Linux or Windows Embedded (have not decided which one). The board will read data from FPGA via PCI Express.
Novice question: do we have to develop our own PCIe driver or we can use something from the operating system? If we need our own, can you recommend a resource?
It really depends on what kind of data you want to transfer with the device. If you just want register read/write you could just mmap /dev/mem and have a user space driver.
If you need to do DMA or interrupt then you'd likely have to write your custom driver.
Yes, unless your device corresponds to a standard device profile, you will need a custom device driver. Because you have not selected your operating system yet, your question about resources is pretty wide open still since obviously the OS selection directly affects driver design. For Windows you probably want to start here. Under Linux, perhaps here.