右手中指指尖麻木是什么原因| 左边头疼是什么原因怎么办| 錾是什么意思| 520送男朋友什么礼物| 左室高电压是什么意思| 胃炎有什么症状| 西安什么山| 女人吃知了有什么好处| 阁下是什么意思| 龙跟什么生肖最配| 指甲月牙代表什么意思| 鱼爱吃什么| 家里为什么会有蚂蚁| 原发性肝ca什么意思| 脸上长水泡似的痘痘是什么原因| ar是什么意思| 鱼缸为什么不能送人| 什么是假性自闭症| 木可以加什么偏旁| 腮腺炎不能吃什么| 大马猴是什么意思| 蟑螂卵什么样| 老公梦见蛇是什么预兆| 心肌炎什么症状| 常熟有什么好玩的地方| 现在流行什么样的衣柜| 剥苔舌是什么原因| 尿检粘液丝高什么意思| 小透明是什么意思| 嘴唇发黑是什么原因引起的| 舌头有麻木感什么原因| 普拉提是什么意思| 新生儿前面头发稀少是什么原因| 毛发变白是什么原因| 小儿鼻炎用什么药好| 练字用什么笔好| 吃什么药能让月经马上来| 宝宝发烧是什么原因引起的| 辅酶是什么| lafuma是什么牌子| 医院五行属什么| 外阴瘙痒用什么药膏擦| 什么是摇滚| 肉鸽是什么意思| 口痰多是什么原因| 怀孕出血是什么颜色的| 红黄是什么颜色| pdw偏低是什么意思| 韭菜吃多了有什么坏处| 慢慢张开你的眼睛是什么歌的歌词| 窦性心动过速是什么意思| 烟酰胺是什么东西| 头晕可以吃什么药| 经期喝什么好| 门可罗雀是什么意思| 受用是什么意思| 艺人是什么意思| 为什么身上会出现淤青| 血小板低是什么原因引起的| 胸小是缺少什么营养| 什么是疣| 菠菜含什么元素最高| 家属是什么意思| 高铁跟动车有什么区别| 什么是血铅| 双向情感障碍吃什么药| 小孩晚上睡觉流口水是什么原因| ci是什么意思| 氧分压高是什么原因| 女性尿道感染吃什么药| 多少年婚姻是什么婚| 吃什么升血小板快| 翘嘴鱼是什么鱼| 天空为什么会下雨| 79年出生属什么生肖| 油嘴滑舌是什么意思| 小人难防前一句是什么| 五月十四号是什么情人节| 胎位左枕前是什么意思| 两女一杯什么意思| 手指甲上有竖纹是什么原因| 1.4什么星座| 血型o型rh阳性是什么意思| chest是什么意思| 脸上长痘痘去医院挂什么科| 为什么正骨后几天越来越疼| 肝病吃什么好得快| izzue是什么牌子| 为什么二楼比三楼好| 宁夏有什么特产| 身上臭是什么原因| 2006年什么年| 糖链抗原是什么意思| 宫颈炎用什么药| 什么是医学检验技术| 消炎药是什么药| 8月份是什么星座| 厘清和理清的区别是什么| 督察是什么级别| 月经前长痘痘是什么原因| 什么匆匆| 人怕出名猪怕壮是什么生肖| 不拘小节是什么意思| 62年的虎是什么命| 522是什么意思| 男人都是大猪蹄子是什么意思| 走路有什么好处及功效| 养老金什么时候补发| 什么时候是排卵期| 木瓜什么时候成熟| 六月十五号是什么星座| 海参多少头是什么意思| 恋童癖是什么意思| 早上起来手发麻是什么原因| ecc是检查什么的| 手脚软无力是什么原因引起的| 利益最大化是什么意思| 10月7日是什么星座| 农历六月十七是什么日子| 什么的长江| 肺部结节挂什么科| 心悸是什么意思| 抻是什么意思| 耳朵发炎用什么药| 黄体不足吃什么药| 精忠报国是什么生肖| 胶原蛋白什么牌子好| 手淫什么意思| 输血四项检查是什么| 子宫肌瘤什么不能吃| 绝对值是什么| 山花对什么| 南瓜子吃多了有什么副作用| 品规是什么意思| 新生儿黄疸高是什么原因| 什么是数位板| 仙人掌能治什么病| 什么操场| 怀孕什么水果不能吃| sin是什么边比什么边| 出家当和尚有什么要求| 问号是什么意思| 五朵金花是什么意思| 梦见玉碎了是什么意思| 花痴什么意思| 病是什么结构的字| 小孩便秘吃什么通便快| 硫是什么颜色| 红房子是什么| ec是什么意思| 苗字五行属什么| 念珠菌阳性是什么病| 金庸原名叫什么| 少校是什么级别| 舌尖有裂纹是什么原因| 多吃菠萝有什么好处| 智齿是什么原因引起的| 露从今夜白下一句是什么| 被蜱虫咬了有什么症状| 为什么手术服是绿色的| 现在什么季节| 透析是什么原理| 颜控什么意思| 终止妊娠是什么意思| 原始鳞状上皮成熟是什么意思| 舌尖痛什么原因| 泌乳素高有什么症状| 眼袋大是什么原因| 吐黄水是什么原因| 八败是什么意思| 喝中药尿黄是什么原因| 玉字是什么结构| 子婴是秦始皇什么人| 什么体质容易长结石| 午时左眼跳是什么兆头| 11度穿什么衣服| 经常便秘吃什么| 尿酸高是什么病| gaba是什么| lu是什么单位| 玄五行属什么| 排卵期是什么时候| 杀手锏是什么意思| 防晒霜和防晒乳有什么区别| 孕妇做唐筛是检查什么| 冥冥中是什么意思| 情投意合是什么意思| 幼儿急疹是什么原因引起的| 挂了是什么意思| 小麦什么时候成熟| 子夜是指什么时间| 美人尖是什么| 12月26日什么星座| 痉挛吃什么药效果好| 叶酸是什么东西| 宫腔粘连带是什么意思| 什么样的女人容易出轨| 白矾是什么东西| 脚肿了是什么原因引起的| 心开窍于什么| 拉肚子吃什么药最有效果| 铁扇公主是什么生肖| 神是什么偏旁| 男人吃洋葱有什么好处| 望周知是什么意思| 感染幽门螺旋杆菌吃什么药| 什么是厌食症| 狗狗吐黄水是什么原因| 投食是什么意思| 棘人是什么意思| 绿豆芽不能和什么一起吃| ns是什么| 压片糖果是什么意思| 梗阻性黄疸是什么病| 木丑念什么| 为什么会子宫内膜增厚| 什么是胰腺炎| rr医学上什么意思| 嘴巴发甜是什么原因| 绯色是什么意思| 水淀粉是什么东西| 割礼是什么意思| 头出汗多是什么原因| 十月二十二是什么星座| 脚底板痛挂什么科| 95年属什么多大| 喝什么解酒最快最有效| 低血压吃什么调理| 上海话小赤佬是什么意思| 为什么早上起来血压高| 扁桃体看什么科室| 唏嘘是什么意思| 连长是什么军衔| 血栓吃什么药化得快| 本意是什么意思| 心肌是什么意思| 胃胀消化不好吃什么药| 子午是什么时间| 秦始皇的母亲叫什么名字| 看食道挂什么科室| 利妥昔单抗是什么药| 带状疱疹可以吃什么水果| 北极熊为什么不怕冷| 脚气是什么菌感染| 南极为什么比北极冷| 眼睛怕光是什么原因| 蜂蜜什么时候喝比较好| 膝盖痛什么原因| 四个自信是什么| 什么的仪式| 上眼皮痒是什么原因| 隐血阳性是什么意思| 什么是奢侈品| 做梦梦到老公出轨代表什么预兆| egcg是什么| 性功能下降吃什么药| 窦性心动过缓吃什么药| 为什么晚上血压比白天高| 越什么越什么| 低钾血症是什么意思| 上海松江有什么好玩的地方| 流星雨是什么意思| 五月初是什么星座| 幽门螺旋杆菌阳性是什么意思| 百度 Skip to main content
Redhat Developers  Logo
  • Products

    Featured

    • Red Hat Enterprise Linux
      Red Hat Enterprise Linux Icon
    • Red Hat OpenShift AI
      Red Hat OpenShift AI
    • Red Hat Enterprise Linux AI
      Linux icon inside of a brain
    • Image mode for Red Hat Enterprise Linux
      RHEL image mode
    • Red Hat OpenShift
      Openshift icon
    • Red Hat Ansible Automation Platform
      Ansible icon
    • Red Hat Developer Hub
      Developer Hub
    • View All Red Hat Products
    • Linux

      • Red Hat Enterprise Linux
      • Image mode for Red Hat Enterprise Linux
      • Red Hat Universal Base Images (UBI)
    • Java runtimes & frameworks

      • JBoss Enterprise Application Platform
      • Red Hat build of OpenJDK
    • Kubernetes

      • Red Hat OpenShift
      • Microsoft Azure Red Hat OpenShift
      • Red Hat OpenShift Virtualization
      • Red Hat OpenShift Lightspeed
    • Integration & App Connectivity

      • Red Hat Build of Apache Camel
      • Red Hat Service Interconnect
      • Red Hat Connectivity Link
    • AI/ML

      • Red Hat OpenShift AI
      • Red Hat Enterprise Linux AI
    • Automation

      • Red Hat Ansible Automation Platform
      • Red Hat Ansible Lightspeed
    • Developer tools

      • Red Hat Trusted Software Supply Chain
      • Podman Desktop
      • Red Hat OpenShift Dev Spaces
    • Developer Sandbox

      Developer Sandbox
      Try Red Hat products and technologies without setup or configuration fees for 30 days with this shared Openshift and Kubernetes cluster.
    • Try at no cost
  • Technologies

    Featured

    • AI/ML
      AI/ML Icon
    • Linux
      Linux Icon
    • Kubernetes
      Cloud icon
    • Automation
      Automation Icon showing arrows moving in a circle around a gear
    • View All Technologies
    • Programming Languages & Frameworks

      • Java
      • Python
      • JavaScript
    • System Design & Architecture

      • Red Hat architecture and design patterns
      • Microservices
      • Event-Driven Architecture
      • Databases
    • Developer Productivity

      • Developer productivity
      • Developer Tools
      • GitOps
    • Secure Development & Architectures

      • Security
      • Secure coding
    • Platform Engineering

      • DevOps
      • DevSecOps
      • Ansible automation for applications and services
    • Automated Data Processing

      • AI/ML
      • Data Science
      • Apache Kafka on Kubernetes
      • View All Technologies
    • Start exploring in the Developer Sandbox for free

      sandbox graphic
      Try Red Hat's products and technologies without setup or configuration.
    • Try at no cost
  • Learn

    Featured

    • Kubernetes & Cloud Native
      Openshift icon
    • Linux
      Rhel icon
    • Automation
      Ansible cloud icon
    • Java
      Java icon
    • AI/ML
      AI/ML Icon
    • View All Learning Resources

    E-Books

    • GitOps Cookbook
    • Podman in Action
    • Kubernetes Operators
    • The Path to GitOps
    • View All E-books

    Cheat Sheets

    • Linux Commands
    • Bash Commands
    • Git
    • systemd Commands
    • View All Cheat Sheets

    Documentation

    • API Catalog
    • Product Documentation
    • Legacy Documentation
    • Red Hat Learning

      Learning image
      Boost your technical skills to expert-level with the help of interactive lessons offered by various Red Hat Learning programs.
    • Explore Red Hat Learning
  • Developer Sandbox

    Developer Sandbox

    • Access Red Hat’s products and technologies without setup or configuration, and start developing quicker than ever before with our new, no-cost sandbox environments.
    • Explore Developer Sandbox

    Featured Developer Sandbox activities

    • Get started with your Developer Sandbox
    • OpenShift virtualization and application modernization using the Developer Sandbox
    • Explore all Developer Sandbox activities

    Ready to start developing apps?

    • Try at no cost
  • Blog
  • Events
  • Videos

韩国触礁客轮搭载163人 已全部获救

百度 最终,天津权健客场3-6负于全北现代。

Using Passt with libvirt, KVM, and QEMU

July 29, 2025
Fernando Lozano
Related topics:
Developer ProductivityLinuxSecurityVirtualization
Related products:
Red Hat Enterprise Linux

Share:

    In a previous article, I explained why developers should use libvirt session virtual machines (VMs) over libvirt system VMs for their inner-loop testing. Session VMs are rootless, but they do not provide ingress network connectivity. If you need to access network services inside your VMs, an easy solution is to configure a libvirt virtual network, backed by a Linux kernel bridge.

    If your work machine runs Fedora Linux 42, or any other Linux distribution with a recent enough virt-install package (including Red Hat Enterprise Linux 10!), there’s an easier and more secure alternative: user-mode networking with Passt. With Passt, you no longer need to manage libvirt virtual networks and thus there is no need for root privileges, provided that libvirt and its tooling are already installed on the work machine.

    Managing libvirt virtual networks, as I did in the previous article, requires root access (or libvirt group membership), which some developers might not have on their work machines. Even if you do, you should avoid using it as much as possible to ensure a good security posture. And don’t be fooled: being a member of the libvirt group makes you root equivalent.

    Using virtual networks was a compromise. It required a one-time privileged operation, and after that you could create and manage rootless VMs. As long as you never connect that virtual network to any real network, the security risk should be minimal.

    But how do you connect to network servers running on rootless VMs if using user-mode networking? You do so by configuring port forwarding, much like you would do with rootless containers.

    Cooking pasta with virtual machines

    If you’re a Podman user, you have probably heard of pasta, the binary that enables Podman to use Passt. Passt is an improved user-mode networking stack, proposed to replace the older Slirp-based stack. pasta became the default for Podman a while ago.

    Remember that VMs, much like containers, are just regular Linux processes, so what works for containers should work for VMs, too. However, while it has always been easy to forward ports to containers, this wasn't the case for VMs until recently.

    Like Podman, libvirt can take advantage of Passt, but until recently, configuring port forwarding required fiddling with XML configuration files. None of the popular front-ends to libvirt, such as Virt-Manager and Cockpit, had support for configuring any settings of user-mode networking.

    To avoid dealing with XML files, and sticking to easy front-ends, my previous article proposes the compromise of configuring a libvirt virtual network, backed by a Linux kernel bridge, and granting access to session VMs to that virtual network.

    Fortunately, things improved with recent updates to the virt-install command (part of the Virt-Manager project) that now include a convenience option to enable port forwarding using the Passt user-mode networking stack. Just add the following to your virt-install command:

    --network passt,portForward:<host-port>:<vm-port>

    Then any application on your host can connect to 127.0.01:<host-port> to access whatever services are listening on vm-port on your VM.

    The convenience option also enables forwarding UDP ports, port ranges, and setting the listening IP address on the host, which you could use to expose your session VMs to access from outside its host. The following example, straight from the man page, illustrates some of those alternatives:

    --network passt,portForward0=7000-8000/udp,portForward1=127.0.0.1:2222:22

    Note

    While it was possible to select Passt and configure port forwarding with previous releases of the virt-install command, it required a long and convoluted syntax. For that reason, I chose not to discuss it in the previous article.

    A concrete example

    I’m running this on my Fedora 42 work machine. First, make sure you have recent enough libvirt tooling. If not, you might need a dnf update.

    $ rpm -q libvirt
    libvirt-11.0.0-2.fc42.x86_64
    $ rpm -q virt-install
    virt-install-5.0.0-2.fc42.noarch

    You need virt-install (or the larger virt-manager package, depending on your Linux distribution) on version 5.0.0 or newer. If you’re on a recent RHEL release, such as RHEL 10.0 or RHEL 9.6, you should be good to go.

    Now, create the simplest VM from the RHEL installation boot ISO and run through the Anaconda prompts. Make sure you create a user with a password and administrator access so you can later ssh as this user.

    $ virt-install --name rhel95pasta --osinfo rhel9.5 --network passt,portForward=8022:22 --memory 4096 --vcpus 2 --disk size=20 --location ~/Downloads/rhel-9.5-x86_64-boot.iso

    Of course, you could use newer (or older) RHEL installation media.

    After the installation finishes, you can ssh into your VM:

    $ ssh -p 8022 flozano@127.0.0.1

    Now be ready for a surprise: your VM might be set to the same hostname as your host. This means your VM's Bash prompt ends up looking exactly like your host's, potentially making it seem as though your SSH client failed to connect. I had to double-check to confirm I was actually in my VM and not the host. The libvirt team is working on this issue. In the meantime, setting a different user name during installation or changing the VM's host name can help avoid confusion.

    $ sudo hostnamectl hostname rhel95pasta
    $ sudo shutdown -r now

    Wait a few moments to reconnect to your rootless VM and enjoy your virtual pasta!

    Why Passt is a better choice

    If you want some context about why Passt and pasta are better alternatives to Slirp, see David Gibson's Rootless Networking presentation from Everything Open 2024 and this blog post by Stefan Hajnoczi: A new approach to usermode networking with passt

    Passt provides a number of performance and security improvements because of its streamlined architecture. Slirp is a decades-old software, created to enable TCP/IP connections over serial lines. It was not designed for container or VM networking.

    Because Passt is the preferred stack and Slirp is not actively maintained anymore, it’s unlikely that convenience options such as port forwarding will ever be implemented for Slirp in any front-end.

    At the time I write this article, you must either use the virt-install command or edit your VMs' libvirt XML to use Passt. None of the popular graphical front-ends to libvirt, such as virt-manager and Cockpit, support selecting Passt as the user-mode networking stack. They only offer two choices: virtual networks or user-mode networking, which implicitly selects Slirp.

    The fact that none of the libvirt front-ends provided an easy way of setting up port forwarding for user-mode networking caused many users to just ignore session VMs and use system VMs every time. This approach was perceived as the only easy way of connecting to network services inside their VMs. That was unfortunate, because a limitation of front-ends encouraged a bad security posture. 

    Thanks to the recent improvements in the virt-install command, there's no longer a compelling reason to avoid using user-mode networking for most of your virtual machine needs. Hopefully other libvirt front-ends will implement similar features soon.

    From local virtualization to enterprise virtualization

    Running hardware-accelerated VMs is a native feature of the Linux kernel, provided by its KVM module. VMs are just Linux processes, nothing fancy there. You never required root access to run VMs natively on Linux, just as you never required it for containers. In both cases, it was more of a limitation from early tools than a conscious design choice that caused rootful operation to be the starting point.

    To make it clear, let’s dig a bit into the architecture of the Linux virtualization stack. 

    Understanding the Linux virtualization stack

    Hardware acceleration for VMs does less than you might think, providing just CPU, memory, and device bus virtualization. Everything else must come from either software-based emulation or hardware passthrough.

    KVM, a feature of the Linux kernel, provides access to the hardware acceleration capabilities, and QEMU, a user space program, provides the remaining hardware emulation required to offer a complete virtual machine abstraction. Your VMs are actually QEMU processes.

    Libvirt is a management layer that coordinates QEMU, KVM, and other Linux kernel features that may be required, depending on which capabilities you need to provide to your VMs.

    Without a user-mode networking stack, libvirt requires root privileges to create virtual network devices. If you need to connect your VMs to real networks—in such a way they look directly connected and can interact with layer 2 and layer 3 protocols—you must connect their virtual network devices to virtual bridge devices, and those bridges to physical network devices. Libvirt virtual networks are an abstraction to manage such groups of virtual network devices and virtual bridges, which are Linux kernel features.

    From desktop to data center: Scaling up virtualization

    Linux-based enterprise virtualization, such as Red Hat OpenShift Virtualization, uses the same libvirt + KVM + QEMU stack, but they also provide advanced software-defined networking over multiple hosts. They use specialized components, such as Open Virtual Networking (OVN), to create those virtual networks, which connect virtual bridge devices from multiple Linux hosts.

    Enterprise virtualization software runs their VMs rootless. This is just good security design. They run their actual VMs, that is, the Linux processes which correspond to those VMs, as unprivileged processes, and restrict elevated privileges for just their components that must manage Linux kernel devices.

    In the end, your local VMs can expect similar performance as enterprise VMs because they run on the same core virtualization stack. For inner-loop testing, developers need ease of use which is secure by default, and libvirt provides that for most desktop Linux distributions, either in a fully rootless mode, or with selected rootful pieces, if you need.

    Many thanks to Andrea Bolognani, Daniel Berrangé, and Stefano Brivio for their review of this article.

    Related Posts

    • Rootless virtual machines with KVM and QEMU

    • Building rootless containers for JavaScript front ends

    • Deliver your applications to edge and IoT devices in rootless containers

    • Rootless containers with Podman: The basics

    • Setting up KVM on Red Hat Enterprise Linux

    • Configure and run a QEMU-based VM outside of libvirt with virt-manager

    Recent Posts

    • Simplify access management for Red Hat Insights for Red Hat Enterprise Linux with new system roles

    • Intro to Redis and PostgreSQL in Red Hat SAP environments

    • Getting started with managed clusters migration

    • Retrieval-augmented generation with Llama Stack and Python

    • Introducing incident detection in Red Hat Advanced Cluster Management for Kubernetes 2.14

    What’s up next?

    Download the OpenShift Virtualization for VMware admins cheat sheet for a quick guide to managing virtual machines within the powerful OpenShift environment.

    Get the cheat sheet
    Red Hat Developers logo LinkedIn YouTube Twitter Facebook

    Products

    • Red Hat Enterprise Linux
    • Red Hat OpenShift
    • Red Hat Ansible Automation Platform

    Build

    • Developer Sandbox
    • Developer Tools
    • Interactive Tutorials
    • API Catalog

    Quicklinks

    • Learning Resources
    • E-books
    • Cheat Sheets
    • Blog
    • Events
    • Newsletter

    Communicate

    • About us
    • Contact sales
    • Find a partner
    • Report a website issue
    • Site Status Dashboard
    • Report a security problem

    RED HAT DEVELOPER

    Build here. Go anywhere.

    We serve the builders. The problem solvers who create careers with code.

    Join us if you’re a developer, software engineer, web designer, front-end designer, UX designer, computer scientist, architect, tester, product manager, project manager or team lead.

    Sign me up

    Red Hat legal and privacy links

    • About Red Hat
    • Jobs
    • Events
    • Locations
    • Contact Red Hat
    • Red Hat Blog
    • Inclusion at Red Hat
    • Cool Stuff Store
    • Red Hat Summit
    ? 2025 Red Hat

    Red Hat legal and privacy links

    • Privacy statement
    • Terms of use
    • All policies and guidelines
    • Digital accessibility

    Report a website issue

    肚子疼吃什么药最有效 二氧化碳分压高说明什么 正常白带是什么样的 乌纱帽是什么意思 8五行属什么
    尿酸ua偏高是什么意思 德育是什么 唯有读书高的前一句是什么 呼吸性碱中毒吃什么药 咖啡豆是什么动物粪便
    25羟维生素d测定是什么 甲亢病是一种什么病 人间烟火什么意思 乙肝15阳性什么意思 河豚为什么有毒
    料酒是什么酒 乳蛾是什么意思 什么的仪式 咸湿佬是什么意思 丝绦是什么意思
    男人性功能太强是什么原因hcv7jop9ns4r.cn 中央办公厅主任什么级别hcv8jop6ns5r.cn 春风得意是什么生肖hcv9jop5ns9r.cn 的意思是什么hcv7jop6ns5r.cn saucony是什么品牌hcv7jop5ns0r.cn
    双鱼和什么星座最配hcv7jop7ns4r.cn 禄蠹是什么意思hcv8jop5ns8r.cn 册封是什么意思hcv9jop6ns7r.cn 金字旁加女念什么字hcv9jop1ns4r.cn logo中文是什么意思hcv8jop4ns5r.cn
    激素是什么hcv8jop3ns5r.cn 血压高的表现症状是什么hcv8jop5ns4r.cn 射手和什么星座最配hcv8jop2ns3r.cn 1989年五行属什么hcv9jop2ns7r.cn 大便干结是什么原因hcv8jop1ns8r.cn
    3月3日是什么节hcv9jop4ns0r.cn 邮编什么意思hcv8jop8ns3r.cn 补钙吃什么好hcv7jop6ns5r.cn 真菌阳性是什么意思bfb118.com 早上出虚汗是什么原因hcv7jop4ns6r.cn
    百度