How to get the same network with QEMU than VirtualBox

Multi tool use
Multi tool use

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
1
down vote

favorite
1












I've 2 VMs Debian 9.4 : one working trough VirtualBox ; the other working trough QEMU. I configured a bridge on my workstation like this :



ip tuntap add dev tap0 mode tap group 1000
ip link set dev tap0 up promisc on
ip addr add 0.0.0.0 dev tap0

#Creating bridge br0
ip link add br0 type bridge
ip link set br0 up
ip link set tap0 master br0
echo "0" | tee --append /sys/class/net/br0/bridge/stp_state
ip addr add 192.168.2.1/24 dev br0

sysctl net.ipv4.conf.tap0.proxy_arp=1
sysctl net.ipv4.conf.enp6s0.proxy_arp=1
sysctl net.ipv4.ip_forward=1

iptables -t nat -A POSTROUTING -o enp6s0 -j MASQUERADE
iptables -A FORWARD -i br0 -o enp6s0 -m state --state RELATED,ESTABLISHED -j ACCEPT
iptables -A FORWARD -i enp6s0 -o br0 -j ACCEPT


In VirtualBox network configuration panel I took tap0 as bridge. The VM can go on the WEB, do update of the system, recieve a connection with ssh and the mean action I expect, install npm package without PB as example : npm install color



I've problem with the QEMU virtual machine that I'm launching with this command :



qemu-system-x86_64 -hda Debian9_amd64_stretch_fr.qcow2 -m 1024 -device e1000,netdev=network0,mac=52:55:00:d1:55:01 -netdev tap,id=network0,ifname=tap0,script=no,downscript=no


With this virtual machine I can go on the WEB, do update of the system, receive a connection with ssh on the VM but I can not do the mean action I expect, install npm package. I've got this error message :



npm ERR! Invalid argument: family must be 4 or 6


You should know I passed many times before to know there is a network problem so is not coming from npm. Is the comparison with the both VM software told me where is coming out.



Thanks







share|improve this question



















  • Use libvirtd and virt-manager to run your VMs. It will take care of virtual networking for you. And save your sanity from having to create those lengthy command lines.
    – Michael Hampton
    Apr 18 at 21:27










  • Easy answer in this case I don't need QEMU and I keep Virtualbox working. How to configure the netdev and device options of QEMU ?
    – dubis
    Apr 19 at 13:31















up vote
1
down vote

favorite
1












I've 2 VMs Debian 9.4 : one working trough VirtualBox ; the other working trough QEMU. I configured a bridge on my workstation like this :



ip tuntap add dev tap0 mode tap group 1000
ip link set dev tap0 up promisc on
ip addr add 0.0.0.0 dev tap0

#Creating bridge br0
ip link add br0 type bridge
ip link set br0 up
ip link set tap0 master br0
echo "0" | tee --append /sys/class/net/br0/bridge/stp_state
ip addr add 192.168.2.1/24 dev br0

sysctl net.ipv4.conf.tap0.proxy_arp=1
sysctl net.ipv4.conf.enp6s0.proxy_arp=1
sysctl net.ipv4.ip_forward=1

iptables -t nat -A POSTROUTING -o enp6s0 -j MASQUERADE
iptables -A FORWARD -i br0 -o enp6s0 -m state --state RELATED,ESTABLISHED -j ACCEPT
iptables -A FORWARD -i enp6s0 -o br0 -j ACCEPT


In VirtualBox network configuration panel I took tap0 as bridge. The VM can go on the WEB, do update of the system, recieve a connection with ssh and the mean action I expect, install npm package without PB as example : npm install color



I've problem with the QEMU virtual machine that I'm launching with this command :



qemu-system-x86_64 -hda Debian9_amd64_stretch_fr.qcow2 -m 1024 -device e1000,netdev=network0,mac=52:55:00:d1:55:01 -netdev tap,id=network0,ifname=tap0,script=no,downscript=no


With this virtual machine I can go on the WEB, do update of the system, receive a connection with ssh on the VM but I can not do the mean action I expect, install npm package. I've got this error message :



npm ERR! Invalid argument: family must be 4 or 6


You should know I passed many times before to know there is a network problem so is not coming from npm. Is the comparison with the both VM software told me where is coming out.



Thanks







share|improve this question



















  • Use libvirtd and virt-manager to run your VMs. It will take care of virtual networking for you. And save your sanity from having to create those lengthy command lines.
    – Michael Hampton
    Apr 18 at 21:27










  • Easy answer in this case I don't need QEMU and I keep Virtualbox working. How to configure the netdev and device options of QEMU ?
    – dubis
    Apr 19 at 13:31













up vote
1
down vote

favorite
1









up vote
1
down vote

favorite
1






1





I've 2 VMs Debian 9.4 : one working trough VirtualBox ; the other working trough QEMU. I configured a bridge on my workstation like this :



ip tuntap add dev tap0 mode tap group 1000
ip link set dev tap0 up promisc on
ip addr add 0.0.0.0 dev tap0

#Creating bridge br0
ip link add br0 type bridge
ip link set br0 up
ip link set tap0 master br0
echo "0" | tee --append /sys/class/net/br0/bridge/stp_state
ip addr add 192.168.2.1/24 dev br0

sysctl net.ipv4.conf.tap0.proxy_arp=1
sysctl net.ipv4.conf.enp6s0.proxy_arp=1
sysctl net.ipv4.ip_forward=1

iptables -t nat -A POSTROUTING -o enp6s0 -j MASQUERADE
iptables -A FORWARD -i br0 -o enp6s0 -m state --state RELATED,ESTABLISHED -j ACCEPT
iptables -A FORWARD -i enp6s0 -o br0 -j ACCEPT


In VirtualBox network configuration panel I took tap0 as bridge. The VM can go on the WEB, do update of the system, recieve a connection with ssh and the mean action I expect, install npm package without PB as example : npm install color



I've problem with the QEMU virtual machine that I'm launching with this command :



qemu-system-x86_64 -hda Debian9_amd64_stretch_fr.qcow2 -m 1024 -device e1000,netdev=network0,mac=52:55:00:d1:55:01 -netdev tap,id=network0,ifname=tap0,script=no,downscript=no


With this virtual machine I can go on the WEB, do update of the system, receive a connection with ssh on the VM but I can not do the mean action I expect, install npm package. I've got this error message :



npm ERR! Invalid argument: family must be 4 or 6


You should know I passed many times before to know there is a network problem so is not coming from npm. Is the comparison with the both VM software told me where is coming out.



Thanks







share|improve this question











I've 2 VMs Debian 9.4 : one working trough VirtualBox ; the other working trough QEMU. I configured a bridge on my workstation like this :



ip tuntap add dev tap0 mode tap group 1000
ip link set dev tap0 up promisc on
ip addr add 0.0.0.0 dev tap0

#Creating bridge br0
ip link add br0 type bridge
ip link set br0 up
ip link set tap0 master br0
echo "0" | tee --append /sys/class/net/br0/bridge/stp_state
ip addr add 192.168.2.1/24 dev br0

sysctl net.ipv4.conf.tap0.proxy_arp=1
sysctl net.ipv4.conf.enp6s0.proxy_arp=1
sysctl net.ipv4.ip_forward=1

iptables -t nat -A POSTROUTING -o enp6s0 -j MASQUERADE
iptables -A FORWARD -i br0 -o enp6s0 -m state --state RELATED,ESTABLISHED -j ACCEPT
iptables -A FORWARD -i enp6s0 -o br0 -j ACCEPT


In VirtualBox network configuration panel I took tap0 as bridge. The VM can go on the WEB, do update of the system, recieve a connection with ssh and the mean action I expect, install npm package without PB as example : npm install color



I've problem with the QEMU virtual machine that I'm launching with this command :



qemu-system-x86_64 -hda Debian9_amd64_stretch_fr.qcow2 -m 1024 -device e1000,netdev=network0,mac=52:55:00:d1:55:01 -netdev tap,id=network0,ifname=tap0,script=no,downscript=no


With this virtual machine I can go on the WEB, do update of the system, receive a connection with ssh on the VM but I can not do the mean action I expect, install npm package. I've got this error message :



npm ERR! Invalid argument: family must be 4 or 6


You should know I passed many times before to know there is a network problem so is not coming from npm. Is the comparison with the both VM software told me where is coming out.



Thanks









share|improve this question










share|improve this question




share|improve this question









asked Apr 18 at 14:05









dubis

4281415




4281415











  • Use libvirtd and virt-manager to run your VMs. It will take care of virtual networking for you. And save your sanity from having to create those lengthy command lines.
    – Michael Hampton
    Apr 18 at 21:27










  • Easy answer in this case I don't need QEMU and I keep Virtualbox working. How to configure the netdev and device options of QEMU ?
    – dubis
    Apr 19 at 13:31

















  • Use libvirtd and virt-manager to run your VMs. It will take care of virtual networking for you. And save your sanity from having to create those lengthy command lines.
    – Michael Hampton
    Apr 18 at 21:27










  • Easy answer in this case I don't need QEMU and I keep Virtualbox working. How to configure the netdev and device options of QEMU ?
    – dubis
    Apr 19 at 13:31
















Use libvirtd and virt-manager to run your VMs. It will take care of virtual networking for you. And save your sanity from having to create those lengthy command lines.
– Michael Hampton
Apr 18 at 21:27




Use libvirtd and virt-manager to run your VMs. It will take care of virtual networking for you. And save your sanity from having to create those lengthy command lines.
– Michael Hampton
Apr 18 at 21:27












Easy answer in this case I don't need QEMU and I keep Virtualbox working. How to configure the netdev and device options of QEMU ?
– dubis
Apr 19 at 13:31





Easy answer in this case I don't need QEMU and I keep Virtualbox working. How to configure the netdev and device options of QEMU ?
– dubis
Apr 19 at 13:31
















active

oldest

votes











Your Answer







StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "106"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
convertImagesToLinks: false,
noModals: false,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);








 

draft saved


draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f438513%2fhow-to-get-the-same-network-with-qemu-than-virtualbox%23new-answer', 'question_page');

);

Post as a guest



































active

oldest

votes













active

oldest

votes









active

oldest

votes






active

oldest

votes










 

draft saved


draft discarded


























 


draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f438513%2fhow-to-get-the-same-network-with-qemu-than-virtualbox%23new-answer', 'question_page');

);

Post as a guest













































































ziknys2YN8H7Pn6g4,uC3z8x,8Lu0LahvCx5CzsYx6FRJz VCiN7jOS0gvpjYlBO rTEHIPpFbkzMX1,y14Dn4xUlcE1Ch8LDnPBR1
eeHjs0k7n8z0HjWfBXgZ4d n

Popular posts from this blog

How to check contact read email or not when send email to Individual?

How many registers does an x86_64 CPU actually have?

Displaying single band from multi-band raster using QGIS