XCP-ng Passthrough Made Easy: A Step-by-Step Guide for USB & PCI

Ғылым және технология

lawrence.video/xcp-ng
Commands used in video
forums.lawrencesystems.com/t/...
XCP-ng Documentation
docs.xcp-ng.org/compute/
My Getting started with XCP-ng Video
• Your Complete Open Sou...
Check out Craft Computer and Jeff's GPU videos
@CraftComputing
Connecting With Us
---------------------------------------------------
+ Hire Us For A Project: lawrencesystems.com/hire-us/
+ Tom Twitter 🐦 / tomlawrencetech
+ Our Web Site www.lawrencesystems.com/
+ Our Forums forums.lawrencesystems.com/
+ Instagram / lawrencesystems
+ Facebook / lawrencesystems
+ GitHub github.com/lawrencesystems/
+ Discord / discord
Lawrence Systems Shirts and Swag
---------------------------------------------------
►👕 lawrence.video/swag/
AFFILIATES & REFERRAL LINKS
---------------------------------------------------
Amazon Affiliate Store
🛒 www.amazon.com/shop/lawrences...
UniFi Affiliate Link
🛒 store.ui.com?a_aid=LTS
All Of Our Affiliates that help us out and can get you discounts!
🛒 lawrencesystems.com/partners-...
Gear we use on Kit
🛒 kit.co/lawrencesystems
Use OfferCode LTSERVICES to get 10% off your order at
🛒 www.techsupplydirect.com?aff=2
Digital Ocean Offer Code
🛒 m.do.co/c/85de8d181725
HostiFi UniFi Cloud Hosting Service
🛒 hostifi.net/?via=lawrencesystems
Protect you privacy with a VPN from Private Internet Access
🛒 www.privateinternetaccess.com...
Patreon
💰 / lawrencesystems
Chapters:
00:00 XCP-ng Passthrough
01:36 How to Pass A USB Device to a VM
04:02 How to add a PCI Device to a VM
10:00 How to remove a PCI Pass-though Devices from a VM
11:40 XCP-ng Affinity Host for devices

Пікірлер: 62

  • @parl-88
    @parl-882 ай бұрын

    Really enjoying these In-Depth XCP-NG video tutorials! Thanks for taking the time to make them. I am becoming such a fan of XCP-NG!

  • @876kc
    @876kc2 ай бұрын

    Thank you for making this video.

  • @LAWRENCESYSTEMS

    @LAWRENCESYSTEMS

    2 ай бұрын

    My pleasure!

  • @allaboutcomputernetworks
    @allaboutcomputernetworks2 ай бұрын

    Thank you so much for making this lovely video!!

  • @Alex_whatever
    @Alex_whatever2 ай бұрын

    I assume this requires the host motherboard and bios supports IOMMU and that it is enabled? Also, why the world is not just not an option in the UI? Same with Proxmox. Though, in Proxmox once you go through the steps to enable PCIe passthrough, you can just do everything else from the GUI. But still, the hypervisor should just detect if the hardware is capable of sharing PCIe devices and then let you set everything from the GUI.

  • @marcogenovesi8570

    @marcogenovesi8570

    2 ай бұрын

    The reason is that nobody cares enough (of the businness customers that actually pay the bills). Same for sr-iov. Afaik the only project that has full GUI for PCIe passthrough setup is Unraid, from version 6.9 onward.

  • @mt_kegan512

    @mt_kegan512

    2 ай бұрын

    ESXI *cough Broadcom has a really nice implementation. I tend to think the OP is more right than wrong tho. I do agree that this is more of a "home-lab" request... But we always want more. I absolutely love XCP-ng & Proxmox, but the full GUI implementation in ESXI was really nice. Just give it to us. It would FACTUALLY make their project better. Additionally, thank you Tom for putting this out. Your content is always great. Love the amount of videos you've been cranking out too. The community really appreciates you and all your hard work!

  • @marcogenovesi8570

    @marcogenovesi8570

    2 ай бұрын

    @@mt_kegan512 xpc-ng and proxmox (and Unraid for that matter) have a plugin API to let the community make GUI plugins for things like these that don't warrant the attention from the "main" dev team. That functionality in Unraid was originally a third party plugin as well.

  • @haxwithaxe

    @haxwithaxe

    2 ай бұрын

    Yup hardware support is required. Iommu support by intel is a mess. I hear AMD is much more sane.

  • @xandrios

    @xandrios

    2 ай бұрын

    @@mt_kegan512 ESXi does this much better indeed. Combined with SR-IOV it is very powerful and we do rely on this for our business. In telecom there are still plenty of reasons why you'd want a PCI card, or port, passthrough in a production environment.

  • @jobtechnologies3492
    @jobtechnologies34922 ай бұрын

    Just did this two weeks ago from your older video lol passed an hba card. Super simple

  • @ralmslb
    @ralmslb2 ай бұрын

    One aspect that was missed on the PCI Device Passthrough, is how to check if the machine you are using even supports it. (xm dmesg)

  • @quisix9
    @quisix92 ай бұрын

    Thank you, great video. Would the same steps also work for GPU-Passthrough?

  • @LAWRENCESYSTEMS

    @LAWRENCESYSTEMS

    2 ай бұрын

    It should

  • @akk2766
    @akk27665 күн бұрын

    Awesome video, Tom. One question: Is it not possible to run modprobe -r to remove the kernel module and avoid a reboot?

  • @LAWRENCESYSTEMS

    @LAWRENCESYSTEMS

    5 күн бұрын

    Not sure, also worth noting they have added pass through options to the web interface

  • @tomklein6540
    @tomklein65402 ай бұрын

    I have also asked in the forums but for newer hardware to be supported they need update their kernel. Come on 4.19 back porting all everything because their storage solution depends on it

  • @ewenchan1239
    @ewenchan12392 ай бұрын

    Two things: 1) I noticed that in the VM, under the Advanced tab, that there is an option for GPUs. Is this the process that we would follow to ennumerate said GPUs so that it will be made available to the VMs? 2) I am guessing that by passing through the PCIe device (e.g. GPU) that you won't be able to SHARE that resource between VMs, correct? (Unlike Proxmox where you can share a GPU across multiple LXC containers.) Thank you.

  • @tomklein6540

    @tomklein6540

    2 ай бұрын

    This is voor vgpu only from what ive seen. If you run xcp-center you can pass through the gpu from there without having to go commandline for this. Although results may vary as this doesn’t work for the nuc 11 and 13 it seems. Devices are detected by the vm but you can’t use them. Did a post in the forum trying to get this resolved.

  • @tomklein6540
    @tomklein65402 ай бұрын

    Great video 👌🏼 Ive been moving stuff off vmware to xcp ng last week and all seem to work great except this part. Been passing through the igpu for years in vmware but for some reason this doesn’t work in xcp ng 8.3. The device gets detected in linux it even shows hardware transcoding but just hangs from there. This happens on a NUC11 and 13. You or anyone else have hint on what could be the problem? I could try 8.2 to see if it is a bug in 8.3…

  • @joshuawaterhousify
    @joshuawaterhousifyАй бұрын

    Hey Tom, watching this while trying to pass the SATA controllers and one of the M.2 drives through to a TrueNAS VM, and I have a feeling from something I've read that there may be issues in doing so for the AsRock Rack X570D4U-2L2T; is that a situation you've tested on your end? I know you use a couple of those (or at least similar), so figured I may as well ask. Will get a HBA if needed, I'd just love not to need to XD

  • @LAWRENCESYSTEMS

    @LAWRENCESYSTEMS

    Ай бұрын

    Not something I have tested.

  • @joshuawaterhousify

    @joshuawaterhousify

    Ай бұрын

    Okay, never mind, got the drives passed through. Now it's just hanging on boot instead...but they're showing in the boot sequence, so maybe I can somehow work through that? May end up as a sticking point, but I'll keep at it for now to see if I can work my way through it.

  • @joshuawaterhousify

    @joshuawaterhousify

    Ай бұрын

    @@LAWRENCESYSTEMS Didn't see this when I put up my other comment, whoops ':D Thanks for getting back to me though :) I seem to have got that sorted, but yeah, TrueNAS Scale's now hanging at "Begin: Running /scripts/local-premount ... done.", or occasionally working through at least some of mounting sda and hanging there instead. I did seem to get further with that than with Core, but I've yet to figure out just what's hanging. Having the issue both with 23.10.2 and 24.04-RC1, with Core 13.0-U6.1 not even getting through install. (Scale also didn't like rebooting after installation with drives connected, and went through install just fine before the SATA controller was passed through...might see how it goes with it passed through with no drives for testing purposes.)

  • @joshuawaterhousify

    @joshuawaterhousify

    Ай бұрын

    And I got it sorted out, as far as I need to for now at least; half the SATA ports passed through and that's all I need at the moment. Issues passing the other controller through, but I can pick up a dedicated controller down the track to resolve that I guess. Either way, it's been a great thing to work through, and your video was a massive assist on it, both for this and many other things I've been working on for moving my setup over to XCP-ng.

  • @rodrimora
    @rodrimora2 ай бұрын

    In a past video you said that passing a pcie card connected to a bunch of HDD's might cause some troubles and it was better to connect the disks directly to the VM (it was a truenas example). Would you still recommend passing the disks individually or the PCI card?

  • @LAWRENCESYSTEMS

    @LAWRENCESYSTEMS

    2 ай бұрын

    When virtualizing something that uses ZFS I recommend passing the controller card through.

  • @janjansen6263
    @janjansen62632 ай бұрын

    Is having to reboot when attaching a usb device a limitation in Xen? My laptop with kvm does handle usb redirection without rebooting the VM

  • @xandrios
    @xandrios2 ай бұрын

    Thanks for the video and explanation. Looking at moving away from VMWare, and relying on passthrough quite heavily, this is pretty much a no-go for XCP-NG. Doing this kind of config from the command line makes it basically unusable for anything other than a hobby environment. Thats a real pity. Also, an important aspect with this is SR-IOV support, allowing one PCI device to be shared over multiple VMs. For instance, a 4 port adapter shared over 4 VM's each getting their own port.

  • @LAWRENCESYSTEMS

    @LAWRENCESYSTEMS

    2 ай бұрын

    XCP-ng does have SR-IOV support and passthrough will probably be added to the web UI in the future but for now it's command line. We don't see too much passthrough in the enterprise work because it bind the VM to that host.

  • @xandrios

    @xandrios

    2 ай бұрын

    @@LAWRENCESYSTEMS It does not necessarily *have* to bind the VM to the host, though. If the same type of hardware device is available at multiple hosts in the cluster, nothing is stopping the software from allowing configuring devices on a cluster level (i.e. define a cluster-wide PCI device and assign a physical device to that resource from every host). The VM could then use the cluster-defined PCI device and run on any of the hosts that offer the PCI resource within the cluster. Of course things like live migration won't work, but HA for example could.

  • @LAWRENCESYSTEMS

    @LAWRENCESYSTEMS

    2 ай бұрын

    That is use case for SR-IOV

  • @GordonGaz
    @GordonGaz2 ай бұрын

    Do pass through USB devices survive a host restart? Testing earlier in the year I found that the USB device would disconnect, workaround being pass through the USB pci controller instead of the USB device

  • @LAWRENCESYSTEMS

    @LAWRENCESYSTEMS

    2 ай бұрын

    Rebooting the host does not remove the USB.

  • @fairsitetechnologies9813
    @fairsitetechnologies98132 ай бұрын

    Not directly on video topic, but has Vates been moving features that used to be in the free version of XOA up into licensed levels? I spun up XOA about 3 years ago and I could do file level restore - now it looks like you have to have a Premium license - is that correct?

  • @LAWRENCESYSTEMS

    @LAWRENCESYSTEMS

    2 ай бұрын

    You can have all the features in the self compiled version but to my knowledge the file level restore has always been a higher license.

  • @tmushy
    @tmushy2 ай бұрын

    Thank you for the wonderful video. It shocks me that this simple thing cant be done in the gui

  • @LAWRENCESYSTEMS

    @LAWRENCESYSTEMS

    2 ай бұрын

    Maybe one day, but it takes time to write that into the UI. It's open source and if you are a dev feel free to help contribute the code.

  • @Banner1986
    @Banner198610 күн бұрын

    The inability to hot-plug USB, as well as the lack of snapshots while they're attached seems like a pretty severe limitation... I know QEMU can do both at least, but is this maybe just a UI limitation for XCP-ng (as it is for proxmox), or does the underlying tech stack have the same limitation as well?

  • @RCrosswell
    @RCrosswell2 ай бұрын

    Do you have to have the XO from sources in order to see the USB's from the gui? I have the same version of XCP-NG running and can't see an USB passthrough using XOA.

  • @LAWRENCESYSTEMS

    @LAWRENCESYSTEMS

    2 ай бұрын

    Make sure you are using the latest version as this is a brand new feature. You can check by going to XOA then Updates in the menu and choose "Release channels Latest" to be on the most current one.

  • @RCrosswell

    @RCrosswell

    2 ай бұрын

    @@LAWRENCESYSTEMS Cheers Dude. Sorted 🤘🏼

  • @EricShum-qm6cz
    @EricShum-qm6cz14 күн бұрын

    Thx for the video Lawrence! I tried GPU passthrough to a Windows VM and it works. However, when I tried GPU (RTX 3090) passthrough on an Ubuntu 22.04 VM, the OS would hang on startup. Is anyone else experiencing this? Does anyone know a solution to this?

  • @Zeric1
    @Zeric120 күн бұрын

    Maybe I missed this, I understand that with USB passthrough you can't do snapshots and the VM has to be shutdown for backups, what about when passing a NIC or passing an HB, does one still have the restrictions on snapshots and backups, or is it only for USB devices?

  • @LAWRENCESYSTEMS

    @LAWRENCESYSTEMS

    20 күн бұрын

    Only USB causes the issue

  • @AlexDiamantopulo
    @AlexDiamantopulo2 ай бұрын

    But the backups wouldd still work for my Home Assistant (I don't care about snapshots)? I also just learned about the 2TB max disk size limitation :(

  • @LAWRENCESYSTEMS

    @LAWRENCESYSTEMS

    2 ай бұрын

    Stuffing large volumes of data into virtualized disks is not good storage design. kzread.info/dash/bejne/Y6lnw8ueZNqZYso.html

  • @AlexDiamantopulo

    @AlexDiamantopulo

    2 ай бұрын

    @@LAWRENCESYSTEMS What would you recommend for 3-4TB MSSQL DB servers? Thank you so much for making these videos, we need to get rid of vmware...

  • @LAWRENCESYSTEMS

    @LAWRENCESYSTEMS

    2 ай бұрын

    @@AlexDiamantopulo if they are running in Windows than you can do an iSCSI attached drive

  • @bahadirm
    @bahadirm2 ай бұрын

    Damn, you literally did a video about the same thing I asked in the Q&A video!

  • @AlexDiamantopulo
    @AlexDiamantopulo25 күн бұрын

    Well... I just installed "patches" on my xcp-ng host with Home Assistant aaaaaaaaaand USB passthrough stopped working... All my Zigbee, BT, etc devices stopped working. Why? Because XCP-NG overwrites /etc/xensource/usb-policy.conf and who knows what else... Time to figure out what to do :./

  • @Zeric1

    @Zeric1

    20 күн бұрын

    I didn't experience this when installing the latest patches, I also have HA virtualized and use USB passthrough on a zigbee dongle. Everything started up and worked normally. There must be some other configuration difference that caused your usb-policy.conf to be overwritten, my usb-policy.conf hasn't changed in six months.

  • @WereCatf
    @WereCatf2 ай бұрын

    Well, that's not a fun dance to attach PCI-devices. You'd think you could do that from XO, given how you can do the same from quite literally every other hypervisor's GUI utilities....!

  • @nelsone.hernandez6654
    @nelsone.hernandez66542 ай бұрын

    2:20 Having to reboot a VM to enable a USB device doesn’t look good. Imagine trying to do that to a server OS. That would imply downtime unless you schedule it

  • @LAWRENCESYSTEMS

    @LAWRENCESYSTEMS

    2 ай бұрын

    USB passthough is not a very common server use case.

  • @pepeshopping
    @pepeshopping2 ай бұрын

    Ugh. Wake me up when you don't need copy, paste into the command line! No snapshots possible when pass-through enabled can be a showstopper, but then, when, why would you need external USBs? Encryption? Passwords? Data? Can be done without the complexity (smb, rdp, even usb over ip). NIC/HBA pass-through to a VM is a real possibility and real scenario, but those solutions are usually "embedded", stateless or reproducible with 1 configuration file, so, not terrible, but they can surely improve or workaround the technical issues.

  • @dan_lev
    @dan_lev2 ай бұрын

    A showcase of why people are just going to pay Broadcom.

Келесі