7 ms·
Understanding QEMU Devices (2018)
- deleted 2y ago[deleted]
- sipofwater 2y ago"USB disk as /dev/sda on a not-rooted smartphone using Termux, QEMU, Alpine Linux": https://news.ycombinator.com/item?id=40507319 https://news.ycombinator.com/item?id=40507319
- SunlitCat 2y agoQEMU along with Bochs were my first tries getting into virtualization / emulation way back (maybe around early 2000s? I can't remember!). Although the emulation / virtualization market already grew larger with more and more options available today, QEMU was (and still is) one of the most awesome projects out there.
- rwmj 2y agoA lot of the options (especially the free ones) are either using qemu or using ideas that were developed early (not actually first) for qemu like virtio. There are just a lot more layers on top these days, and not always for the better.
- skrtskrt 2y agoProxmox is great as a FOSS hypervisor, but their docs for doing pretty much anything advanced are just "here's a qemu command".
- aaronius 2y agohmm, if you refer to the `qm` command, that is not from Qemu itself but a Proxomx CLI tool :) https://git.proxmox.com/?p=qemu-server.git;a=blob;f=PVE/CLI/qm.pm;h=b105830fa6f558e0efae0eb6efe66a764cc6b066;hb=HEAD https://git.proxmox.com/?p=qemu-server.git;a=blob;f=PVE/CLI/...
- koala_man 2y agoBack in the day I ran Bochs in all its 4 Bogomips glory on a university IP address and went to IRC channels where script kiddies were "trading root". I let them go first, and watched through an instrumented terminal how they clumsily installed a rootkit, then inevitably refused to give anything in return and laughed calling me a noob. Their laughter was short lived. I had even spent quite a bit of effort kludging the kernel to report much higher specs than Bochs could deliver, but all that effort was wasted because no one knew how to check.
- swozey 2y agoQEMU is used in basically every single hardware vendor today and has been since I've been in virtualization/containerization tech (2010+). I've only seen Vmware (gsx/esx) at Windows shops for things like big Exchange clusters, etc. Every CDN I've worked at used qemu.
- i_am_a_peasant 2y agoThere's still a lot of Xen out there
- checker659 2y agoWhat is the definitive new-comer friendly guide to QEMU? Not just about using it but also understanding its internals (say to add new instructions to a supported ISA etc)?
- sipofwater 2y agohttps://www.qemu.org/documentation/ https://www.qemu.org/documentation/
- checker659 2y agoI am looking for some hand-holding with this. The documentation seems more for reference (albeit a bit lack-luster if I may say so).
- bonzini 2y agoIf there are any specific topics that you'd like covered, please ask.
- cpach 2y agoWhat are your goals? Are you interested in emulation (i.e. running a VM that uses another architecture than your physical computer) or in virtualization? (i.e. running a VM that uses the same architecture)
- checker659 2y agoWell both. I'm interested in implementing an ISA extension (not sure if you know about CHERI). Also, there are reference implementations for aarch64 and risc-v that I'd like to understand.
- hnthrowaway0328 2y agoJust curious, what about simulation? I heard that simulation is more serious than emulation and targets for say pipeline level emulation, but maybe it's just a fancier word?
- deleted 2y ago[deleted]
- zorked 2y agoqemu is a treasure and reading its source to learn how computers work is very fun.
- _mlbt 2y agoIf you’re on a Mac, UTM is an excellent wrapper around Qemu. https://mac.getutm.app/ https://mac.getutm.app/
- adeptima 2y agoyou can choose Apple virtualisation in UTM instead of QEMU too. Apple virtualization is optimized for M1+
- cpach 2y agoQEMU has a Hypervisor[0] backend these days, called “hvf”. https://wiki.qemu.org/Features/HVF https://wiki.qemu.org/Features/HVF [0] “Hypervisor” is a “sibling” to the Virtualization framework. IMHO, the naming is incredibly confusing (:
- zamadatix 2y agoThat's a bit like saying "instead of ext4 you can use an SSD" in that the things involved span multiple layers. When you select the option to use Apple virtualization framework in UTM you're still using QEMU, what you're changing is the backend QEMU is using for the CPU virtualization.
- ashconnor 2y agoDocs: https://developer.apple.com/documentation/virtualization https://developer.apple.com/documentation/virtualization
- anonymousDan 2y agoThis is such a fantastic description of what is going on underneath the hood - it took me quite a while to understand how qemu works, wish I had seen this before!
- adeptima 2y agoWarning for humans! If you are trying to run a virtual PC on QEMY let's say on bare metal hosting from hetzner, you will very soon discover - QEMU is a dead slow without actual graphic card or at best you will get all kind of funky missing libs error messages on Ubuntu and other OS in very surprise spots. Had a very good experience simulating K8s cluster with QEMU aka studing K8s hard way once I figure out how networking actually works between virtual machines and domains can be assigned with external proxy.
- yjftsjthsd-h 2y agoWhy would qemu care about having a graphics card? Do you mean that whatever system you were running inside qemu expected a GPU and was slow without it?
- wmf 2y agoIf the OP was running a virtual desktop on a server with no GPU then they probably had to fall back to software rendering which can be slow. This isn't QEMU's fault per se; if you physically don't have a GPU then you don't have a GPU.
- adeptima 2y agocorrect. thank you for phrasing it better
- TeeMassive 2y ago> Had a very good experience simulating K8s cluster with QEMU aka studing K8s hard way once I figure out how networking actually works between virtual machines and domains can be assigned with external proxy. This is an awesome use of QEMU! I'm both interested in learning K8s and what goes on under the hood at the kernel level because I do cloud connected IoT stuff, so I'll definitely use that! Is there any kind of "build the kernel from scratch" project for that kind of stuff?
- adeptima 2y ago
- apitman 2y ago> Understanding QEMU... Best of luck
- ashconnor 2y agoFollowed by libvirt, VirtIO, KVM, qcow2. If only there was one book or course to pull it all together.
- matheusmoreira 2y ago> QEMU actually has the ability to glue together a lot of different host formats (raw, qcow2, qed, vhdx, …) > and protocols (file system, block device, NBD, Ceph, gluster, …) Yeah, and it's awesome. With qcow2 images mounted via nbd, I was able to manipulate ddrescue images without modifying the original. Truly one of the most useful software ever written. I even use it on Android with Termux to use and test x86_64 software. I wish there was a step by step porting and implementation guide. I tried to port the open source Sensor Watch board to QEMU in order to facillitate software development for it. Didn't get very far. I'm not particularly knowledgeable about electronics but I had all the hardware documentation, I feel like it should have been enough.
- israrkhan 2y agoQEMU is a great piece of software. I use it regularly to debug various cross compiled kernel images under gdb without requiring actual ARM hardware (buildroot + custom kernel + gdb).
- mgerdts 2y ago> so the QEMU developers have added the virtio-net card (a PCI hardware specification, although no bare-metal hardware exists yet that actually implements it) Things have changed since 2018. BlueField DPUs provide virtio network [1] and block [2] devices in the host PCI space. These can be passed through to VMs using vfio-pci in the host. 1. https://docs.nvidia.com/networking/display/bluefieldvirtionetv190/Virtio-net+Deployment https://docs.nvidia.com/networking/display/bluefieldvirtione... 2. https://docs.nvidia.com/networking/display/bluefield2snap380 https://docs.nvidia.com/networking/display/bluefield2snap380 Disclaimer: I work for NVIDIA, have used BlueField DPUs, but have not used the virtio feature.
- freedomben 2y agoDon't feel obligated to answer if you shouldn't, but how seriously is Nvidia taking Linux nowadays? With the rise of ML is linux being seen as an important support target?
- wtallis 2y agoNVIDIA's business these days is dominated by datacenter products that are almost exclusively used with Linux. This has had almost no effect on their approach toward dealing with/integrating with Linux. They did follow in AMD's footsteps and adopted a driver model with an open-source kernel component and closed-source userspace components.
- moondev 2y agoIt can act as a PCIE root as well is that correct? I assume by connecting it to the input of a PCIE switch with other disks attached downstream, but would love to learn more and what PCIE switches are known to work.
- mgerdts 2y agoThe models of BlueField DPUs I’ve worked with have no storage (aside from eMMC to boot the DPU) directly attached. They typically run SPDK, then SPDK block devices are presented to the host as NVMe namespaces or virtio-blk devices. If using NVMe-oF with RDMA, this can provide a zero copy IO path to remote storage. For NVMe, the devices may be presented to the host as PFs or VFs. I assume but do not know that it would be the same for virtio devices.