本站支持搜索的镜像仓库:Docker Hub、gcr.io、ghcr.io、quay.io、k8s.gcr.io、registry.gcr.io、elastic.co、mcr.microsoft.com
Docker container for running virtual machines using QEMU.
Web-based viewer to control the machine directly from your browser
Supports .iso, .img, .qcow2, .vhd, .vhdx, .vdi, .vmdk and .raw disk formats
High-performance options (like KVM acceleration, kernel-mode networking, IO threading, etc.) to achieve near-native speed
services: qemu: image: qemux/qemu container_name: qemu environment: BOOT: "mint" devices: - /dev/kvm - /dev/net/tun cap_add: - NET_ADMIN ports: - 8006:8006 volumes: - ./qemu:/storage restart: always stop_grace_period: 2m
docker run -it --rm --name qemu -e "BOOT=mint" -p 8006:8006 --device=/dev/kvm --device=/dev/net/tun --cap-add NET_ADMIN -v "${PWD:-.}/qemu:/storage" --stop-timeout 120 docker.io/qemux/qemu
kubectl apply -f [***]
 are enabled in your BIOS.
you enabled "nested virtualization" if you are running the container inside a virtual machine.
you are not using a cloud provider, as most of them do not allow nested virtualization for their VPS's.
If you did not receive any error from kvm-ok but the container still complains about a missing KVM device, it could help to add privileged: true to your compose file (or sudo to your docker command) to rule out any permission issue.
When using bridge networking, you can expose ports by adding them to your compose file. If you want to be able to connect to the SSH service of the machine for example, you would add it like this:
ports: - 2222:22
This will make port 2222 on your host redirect to port 22 of the virtual machine.
When using user-mode networking (for example when running under Podman), you will also need to add those ports to the USER_PORTS variable like this:
environment: USER_PORTS: "22,80,443"
By default, the container uses bridge networking, which shares the IP address with the host.
If you want to assign an individual IP address to the container, you can create a macvlan network as follows:
docker network create -d macvlan \ --subnet=192.168.0.0/24 \ --gateway=192.168.0.1 \ --ip-range=192.168.0.100/28 \ -o parent=eth0 vlan
Be sure to modify these values to match your local subnet.
Once you have created the network, change your compose file to look as follows:
services: qemu: container_name: qemu ..<snip>.. networks: vlan: ipv4_address: 192.168.0.100 networks: vlan: external: true
An added benefit of this approach is that you won't have to perform any port mapping anymore, since all ports will be exposed by default.
[!IMPORTANT] This IP address won't be accessible from the Docker host due to the design of macvlan, which doesn't permit communication between the two. If this is a concern, you need to create a second macvlan as a workaround.
After configuring the container for macvlan, it is possible for the VM to become part of your home network by requesting an IP from your router, just like a real PC.
To enable this mode, in which the container and the VM will have separate IP addresses, add the following lines to your compose file:
environment: DHCP: "Y" devices: - /dev/vhost-net device_cgroup_rules: - 'c *:* rwm'
To create additional disks, modify your compose file like this:
environment: DISK2_SIZE: "32G" DISK3_SIZE: "64G" volumes: - ./example2:/storage2 - ./example3:/storage3
It is possible to pass-through disk devices or partitions directly by adding them to your compose file in this way:
devices: - /dev/sdb:/disk1 - /dev/sdc1:/disk2
Use /disk1 if you want it to become your main drive, and use /disk2 and higher to add them as secondary drives.
To pass-through a USB device, first lookup its vendor and product id via the lsusb command, then add them to your compose file like this:
environment: ARGUMENTS: "-device usb-host,vendorid=0x1234,productid=0x1234" devices: - /dev/bus/usb
To share files with the host, first ensure that your guest OS has 9pfs support compiled in or available as a kernel module. If so, add the following volume to your compose file:
volumes: - ./example:/shared
Then start the container and execute the following command in the guest:
mount -t 9p -o trans=virtio shared /mnt/example
Now the ./example directory on the host will be available as /mnt/example in the guest.
You can create the ARGUMENTS environment variable to provide additional arguments to QEMU at runtime:
environment: ARGUMENTS: "-device usb-tablet"
If you want to see the full command-line arguments used, you can set:
environment: DEBUG: "Y"
![Stars]([***]
免费版仅支持 Docker Hub 加速,不承诺可用性和速度;专业版支持更多镜像源,保证可用性和稳定速度,提供优先客服响应。
免费版仅支持 docker.io;专业版支持 docker.io、gcr.io、ghcr.io、registry.k8s.io、nvcr.io、quay.io、mcr.microsoft.com、docker.elastic.co 等。
当返回 402 Payment Required 错误时,表示流量已耗尽,需要充值流量包以恢复服务。
通常由 Docker 版本过低导致,需要升级到 20.x 或更高版本以支持 V2 协议。
先检查 Docker 版本,版本过低则升级;版本正常则验证镜像信息是否正确。
使用 docker tag 命令为镜像打上新标签,去掉域名前缀,使镜像名称更简洁。
探索更多轩辕镜像的使用方法,找到最适合您系统的配置方式
通过 Docker 登录方式配置轩辕镜像加速服务,包含7个详细步骤
在 Linux 系统上配置轩辕镜像源,支持主流发行版
在 Docker Desktop 中配置轩辕镜像加速,适用于桌面系统
在 Docker Compose 中使用轩辕镜像加速,支持容器编排
在 k8s 中配置 containerd 使用轩辕镜像加速
在宝塔面板中配置轩辕镜像加速,提升服务器管理效率
在 Synology 群晖NAS系统中配置轩辕镜像加速
在飞牛fnOS系统中配置轩辕镜像加速
在极空间NAS中配置轩辕镜像加速
在爱快ikuai系统中配置轩辕镜像加速
在绿联NAS系统中配置轩辕镜像加速
在威联通NAS系统中配置轩辕镜像加速
在 Podman 中配置轩辕镜像加速,支持多系统
配置轩辕镜像加速9大主流镜像仓库,包含详细配置步骤
无需登录即可使用轩辕镜像加速服务,更加便捷高效
需要其他帮助?请查看我们的 常见问题 或 官方QQ群: 13763429