 In this video, we're going to cover how to set up USB pass-through and PCI pass-through in XCPNG to the virtual machines that are running on that host. Something of note, they recently added the USB pass-through to the web UI, so that one's going to be really simple. And it's not too much command line work to set up the PCI pass-through, but I will have all the commands I use linked down below that you'll find on my forums, as well as a link to the documentation for XCPNG, which has a lot of these in there as well, so let's get started. Are you an individual or forward-thinking company looking for expert assistance with network engineering, storage, or virtualization projects? Perhaps you're an internal IT team seeking help to proactively manage, monitor, or secure your systems. We offer comprehensive consulting services tailored to meet your specific project needs. Whether you require fully managed or cool managed IT services, our experienced team is ready to step in and help. We specialize in supporting businesses that need IT administration or IT team seeking an extra layer of support to enhance their operations. To learn more about any of our services, head over to our website and fill out the higher-ups form at laurancesystems.com. Let us start crafting the perfect IT solution for you. If you want to show some extra love for our channel, check out our swag store and affiliate links down below that will lead you to discounts and deals for products and services we've discussed on this channel. With the ad read out of the way, let's get you back to the content that you really came here for. Now we're going to start by showing the USB Pass True. I'm running the latest version of Zen Orchestra that is up to date as of February 29th of 2024, so it is the self-compiled version, so this is completely the open source you can do this yourself at home version. I've got a link to a video on how to compile this. We're going to go over here to home and then host. From the host, we can go here to advanced and we can see what USBs are available on this host. So I have a sand disk and this is a Z-Wave adapter that I plugged in. Let's go back over here and look at the different VMs we have running. We have the U2 demo one. We can go to the console and we can see that there's currently nothing plugged in here. Let's go to advanced and plug in each of those devices. So if we create a VUSB, we're going to go ahead and plug in the Z-Wave device and we'll plug in the sand disk. Both these are plugged in, but it will let you know the VUSB was not going to work until you start and stop this VM. So if we go into the console, still nothing here. So let's go ahead and just stop it. I'm going to start it back up. If we go over here to advanced and scroll down, you'll see that both of these are connected. So let's go back over to the console, go here, this PC and there's my sand disk that I have. If we go to the device manager, there is the ZigBee and Z-Wave USB device that I have plugged in. It's pretty straightforward to attach these. And if you would like to detach them, they can be detached without shutting it down. So if we go here and just remove them, go back over to the console, it's gone there. And so is the other one. One thing I want to make note of is if you have them attached, this will prohibit your snapshots from working. They will not work with a USB attach. You'll have to detach them to get the snapshot to work. But in the case of doing a backup, the backups can be done provided you do them in offline mode. They're aware that when the system is in offline mode, they can be backed up. So if we were to look at one of the backups, we'll scroll down here. You scroll down under advanced, you choose the offline backup. This will allow you to back these up while leaving those USBs attached if you need to. Now let's talk about how to pass through any PCI devices attached to this host. We're going to SSH into the host. And the first thing you want to do is run LSPCI. And I'm going to put a capital D. You don't have to. I'll show you without the D. You get a list of devices. But we want to use a dash D just to make it a little bit easier because I'm really in the habit of copying, pasting things to make sure I get it right. And we need the entirety, including these four zeros that prefix this. So we need to find the devices now that we want. And we have a couple of them. We have a real tech ethernet control that I want to pass through. And then I also have this ever media device that I want to pass through. This is the video capture card that I plugged in just to show you how to pass these devices through. So we have this one at this address here. And then we have the real tech ethernet right here. So these are the two addresses we need in their entirety. And I can show you the command that's actually going to pass them through. But before you pass them through, you're actually hiding them from the host to use because by default, the host is going to boot and then assume those devices. So in order to allow those devices to be passed through, we need to hide them from what they refer to as DOM zero. The command we use for that is opt slash zen source, lib exact command line, set DOM zero, zen PCI back hide. And then there is that number that we had from the PCI device name, the four zeros, colon two a colon zero zero dot zero. So exactly like this. And as I said, these will be in the forums. This is now told DOM zero, it's not allowed to use that device. Now I said there's two of them, but I want to show you how this works. This command will show devices that are hidden from DOM zero. We can see that we have that one on there, which is the real tech adapter. But if we run this command and we hide 10 colon zero zero, this is the average media device. And then we run the command again to show the list of devices that are being hidden from DOM zero, you'll see there's only one. It overwrites it each time you do this. So you actually need to put them all in one command for each device that you want on listed. So let me go ahead and show you the full command for that, which it's still the Zen PCI back hide. And we just put the second device or third or fourth, so on and so forth, all within this one command. So we run the command like this. And then we show them, you can now see that both devices are going to be hidden. Now these are not activated until you reboot. So from here, we're just going to go ahead and reboot this server. Now that we've added those commands. And by doing that, this will restart the server with those parameters at boot. So DOM zero will not be able to use these devices and we'll be able to assign them to a virtual machine. Okay, now the system's been rebooted, we're going to run Excel space PCI assignable list. This shows us what's available to be assigned to a VM. If you don't have anything here, go back to the other steps because you may have missed it or you didn't reboot your server. Now for the next steps, we're going to have to pick a virtual machine to assign it to. So let's go back over to Zen Orchestra. And I want to assign these to this Windows VM. The first thing you need is this UUID. And we're just going to hit copy to clipboard because all the parameters you assign are all done so via UUID, which is how internally Zen identifies that virtual machine. Now I will note you should be adding these while the virtual machine is off. But if you do add them when it's on, they won't show up until you start and stop that virtual machine. Now we can go through the full command, which is XE VM dash param set other config colon PCI equals zero slash the name of the device, and then the UUID of that virtual machine. Now we can go up and start this virtual machine, go into our device manager. And there's our ever media controller that we pass through. Well, let's go ahead and pass the real tech through now. So if we hit stop, go back over to the command line, issue the same command again, but we're going to add a comma a zero slash or zeros to a and this is the real tech device in the same UUID. If we were to omit this and let's just do it as a demonstration here and we only added the real tech device. It's not cumulative. This will only add the real tech, but now the average media wouldn't be there. This command VM param get, then the param name other config and then the UUID will show which devices are attached. And you can see them right here is the first line where it says PCI and we're only seeing the real tech. So we want to do that full command that has both the devices in here. So press enter up arrow twice so I can get to this other one and do the get config. Now you can see that both devices have been added right here. So now if we go back and start our VM, go back into the device manager or network adapters, we'll see the real tech and then there's our average media adapter. So we've added both. Something I want to note is probably people are wondering what happens if you add it to want more than one virtual machine, but I've actually already done that in the background. That's why I have this other one here. So if we try to start this virtual machine, we're going to get an error and it tells us what devices are matching. And this one happens to match the average media device. So that means I have that assigned to here. So if you try to start multiple VMs with that same assignment, it won't work. So let's go back over here to home and stop this VM. And I'll show you how to remove devices from a virtual machine. The next of the command XC VRM param set other config PCI, we're just omitting the rest of the information after the PCI that lists the devices. And if we do the get parameters, you can see that they're now missing. Now one last thing of note is if you would like to get rid of all of the devices that you hid, you can actually run that same tool we showed earlier, the Zen command line delete dom zero, and then Zen PCI back hide, this command will actually clear them all out. Of course, you'll still have to reboot and it'll remove them from the availability to be assigned to host. Now I do recommend you read through the XC PNG documentation on this, just so you can get the concept. If you want to go a little further and they have some of those commands in there, as well as my forum post, which has all the commands that I used for this video. So you didn't have to try to read them off the screen, although I tried to make it as concise and clear by zooming in as I can. But yes, those commands are a little bit long. Something you should know though is that all these parameters are stored within the VM. So when you use the Zen Orchestra backup tools, it does back up all those parameters as well. And if you start shuffling or moving PCI devices and you get any of those device not available, that is why I made sure you were clear on how to remove any of the devices. I didn't want to cover adding them. And then when you restore this VM to maybe another host that doesn't have those and you run into some errors, you'll want to make sure you go through and remove those because it tells you that device is not available if that device is not on another host. Obviously, something always to consider when you're doing this is the fact that this binds that VM to the host. There actually is an option if you have this inside of a resource pool to set an affinity host where you want that VM to start on that host, because well, it's the one that you've passed through the devices. So there are methods by which you can handle this. But as I noted, you are going to be binding that VM to start only on the host where that PCI device that you've passed through is available. Now, I did this demo with my evermedia card and with a real tech card that was on board. But yes, this should work really with any PCI device. So any graphics system should work. I don't know if there's any catches on that. Jeff from Craft Computing certainly has a lot of videos about NVIDIA catches on certain ones when you do pass through. But functionally, the PCI device will pass through. It comes down to some of the driver issues you may run into with certain devices. But the device will work. And this does include if you wanted to virtualize TrueNAS and you want to pass through a controller card. This is that same methodology you would follow. Or if you want to virtualize your firewall, such as PF Sense, and you didn't want to deal with the Zen adapters, you wanted to pass through a network card, such as maybe a four port network card that's PCI, or maybe whatever you have, this is the same idea. The best way to do is to pass it through where you can virtualize the OS, but still allow that underlying VM to have full access to the hardware. This is definitely the way to do that. Like and subscribe if you want to see more content from this channel, head over to my forums, forums.lordsystems.com, to engage with me on this and other topics, and head over to lordsystems.com to connect with me on whatever socials you can find me on there. Thanks.