Loading docker-compose.yml +0 −5 Original line number Diff line number Diff line Loading @@ -4,14 +4,9 @@ services: container_name: qemu image: qemux/qemu-docker environment: RAM_SIZE: "1G" CPU_CORES: "1" DISK_SIZE: "16G" BOOT: "https://dl-cdn.alpinelinux.org/alpine/v3.19/releases/x86_64/alpine-virt-3.19.1-x86_64.iso" devices: - /dev/kvm device_cgroup_rules: - 'c *:* rwm' cap_add: - NET_ADMIN ports: Loading readme.md +2 −0 Original line number Diff line number Diff line Loading @@ -169,6 +169,8 @@ docker run -it --rm --name qemu -e "BOOT=http://example.com/image.iso" -p 8006:8 ```yaml environment: DHCP: "Y" devices: - /dev/vhost-net device_cgroup_rules: - 'c *:* rwm' ``` Loading src/network.sh +11 −9 Original line number Diff line number Diff line Loading @@ -25,8 +25,14 @@ ADD_ERR="Please add the following setting to your container:" configureDHCP() { # Create a macvtap network for the VM guest # Create the necessary file structure for /dev/vhost-net if [ ! -c /dev/vhost-net ]; then if mknod /dev/vhost-net c 10 238; then chmod 660 /dev/vhost-net fi fi # Create a macvtap network for the VM guest { ip link add link "$VM_NET_DEV" name "$VM_NET_TAP" address "$VM_NET_MAC" type macvtap mode bridge ; rc=$?; } || : if (( rc != 0 )); then Loading Loading @@ -188,8 +194,10 @@ configureNAT() { NET_OPTS="-netdev tap,ifname=$VM_NET_TAP,script=no,downscript=no,id=hostnet0" if [ -c /dev/vhost-net ]; then { exec 40>>/dev/vhost-net; rc=$?; } 2>/dev/null || : (( rc == 0 )) && NET_OPTS="$NET_OPTS,vhost=on,vhostfd=40" fi configureDNS Loading Loading @@ -279,12 +287,6 @@ if [[ "$NETWORK" != [Yy1]* ]]; then return 0 fi if [ ! -c /dev/vhost-net ]; then if mknod /dev/vhost-net c 10 238; then chmod 660 /dev/vhost-net fi fi getInfo html "Initializing network..." Loading Loading
docker-compose.yml +0 −5 Original line number Diff line number Diff line Loading @@ -4,14 +4,9 @@ services: container_name: qemu image: qemux/qemu-docker environment: RAM_SIZE: "1G" CPU_CORES: "1" DISK_SIZE: "16G" BOOT: "https://dl-cdn.alpinelinux.org/alpine/v3.19/releases/x86_64/alpine-virt-3.19.1-x86_64.iso" devices: - /dev/kvm device_cgroup_rules: - 'c *:* rwm' cap_add: - NET_ADMIN ports: Loading
readme.md +2 −0 Original line number Diff line number Diff line Loading @@ -169,6 +169,8 @@ docker run -it --rm --name qemu -e "BOOT=http://example.com/image.iso" -p 8006:8 ```yaml environment: DHCP: "Y" devices: - /dev/vhost-net device_cgroup_rules: - 'c *:* rwm' ``` Loading
src/network.sh +11 −9 Original line number Diff line number Diff line Loading @@ -25,8 +25,14 @@ ADD_ERR="Please add the following setting to your container:" configureDHCP() { # Create a macvtap network for the VM guest # Create the necessary file structure for /dev/vhost-net if [ ! -c /dev/vhost-net ]; then if mknod /dev/vhost-net c 10 238; then chmod 660 /dev/vhost-net fi fi # Create a macvtap network for the VM guest { ip link add link "$VM_NET_DEV" name "$VM_NET_TAP" address "$VM_NET_MAC" type macvtap mode bridge ; rc=$?; } || : if (( rc != 0 )); then Loading Loading @@ -188,8 +194,10 @@ configureNAT() { NET_OPTS="-netdev tap,ifname=$VM_NET_TAP,script=no,downscript=no,id=hostnet0" if [ -c /dev/vhost-net ]; then { exec 40>>/dev/vhost-net; rc=$?; } 2>/dev/null || : (( rc == 0 )) && NET_OPTS="$NET_OPTS,vhost=on,vhostfd=40" fi configureDNS Loading Loading @@ -279,12 +287,6 @@ if [[ "$NETWORK" != [Yy1]* ]]; then return 0 fi if [ ! -c /dev/vhost-net ]; then if mknod /dev/vhost-net c 10 238; then chmod 660 /dev/vhost-net fi fi getInfo html "Initializing network..." Loading