为什么 qemu 无法使用私有虚拟网桥创建私有网络?我得到了 "network script /etc/qemu-ifup failed with status 256"”
Why qemu failled to create private network with private virtual bridge? I got "network script /etc/qemu-ifup failed with status 256""
我想在专用网络上创建一个虚拟机。
我正在关注这个网站 http://www.linux-kvm.org/page/Networking 以帮助配置我的 qemu。
我使用以下命令创建了一个虚拟机:
sudo qemu-system-x86_64 -hda image.qcow2 -enable-kvm -netdev tap,id=tap1 -device rtl8139,netdev=tap1
我得到了:
qemu-system-x86_64: -netdev tap,id=tap1: network script /etc/qemu-ifup failed with status 256
我正在使用拱门。我创建了一座桥:
sudo ip link add br0 type bridge
默认情况下,我在 /etc/qemu-ifup 中没有文件:
所以,我创建了自己的,就像在这个网站上推荐的那样 http://www.linux-kvm.org/page/Networking:
#!/bin/sh
set -x
switch=br0
if [ -n "" ];then
ip tuntap add mode tap user `whoami`
ip link set up
sleep 0.5s
ip link set master $switch
exit 0
else
echo "Error: no interface specified"
exit 1
fi
我遇到了同样的错误。
我做错了什么?
编辑:
我需要向 qemu-ifup
添加权限。
所以现在可以了。感谢 Karthik Prasad。
我需要给 qemu-ifup 添加可执行权限。所以现在可以了。感谢 Karthik Prasad。
我想在专用网络上创建一个虚拟机。
我正在关注这个网站 http://www.linux-kvm.org/page/Networking 以帮助配置我的 qemu。
我使用以下命令创建了一个虚拟机:
sudo qemu-system-x86_64 -hda image.qcow2 -enable-kvm -netdev tap,id=tap1 -device rtl8139,netdev=tap1
我得到了:
qemu-system-x86_64: -netdev tap,id=tap1: network script /etc/qemu-ifup failed with status 256
我正在使用拱门。我创建了一座桥:
sudo ip link add br0 type bridge
默认情况下,我在 /etc/qemu-ifup 中没有文件:
所以,我创建了自己的,就像在这个网站上推荐的那样 http://www.linux-kvm.org/page/Networking:
#!/bin/sh
set -x
switch=br0
if [ -n "" ];then
ip tuntap add mode tap user `whoami`
ip link set up
sleep 0.5s
ip link set master $switch
exit 0
else
echo "Error: no interface specified"
exit 1
fi
我遇到了同样的错误。
我做错了什么?
编辑:
我需要向 qemu-ifup
添加权限。
所以现在可以了。感谢 Karthik Prasad。
我需要给 qemu-ifup 添加可执行权限。所以现在可以了。感谢 Karthik Prasad。