You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
45 lines
1.8 KiB
Plaintext
45 lines
1.8 KiB
Plaintext
There are two main ways to set up networking on OS X / macOS, as it does not
|
|
function with what QEMU defaults to for network settings:
|
|
|
|
-----------------------------------
|
|
User Mode Networking (Easier Setup)
|
|
-----------------------------------
|
|
|
|
By default, QEMU uses user mode networking (SLiRP). This networking mode is the
|
|
slowest and is not visible via the outside network, but requires no host-side
|
|
setup, so it's perfect if you just want internet but don't care about latency
|
|
or about connecting to the VM from an external source.
|
|
|
|
The problem that we run into here is that OS X is nitpicky about what emulated
|
|
networking devices it is willing to accept, so we need to specify the network
|
|
configuration to use the e1000 emulated card with SLiRP networking.
|
|
|
|
In order to do this, change the line in your qemu-system-x86_64 command (found
|
|
in boot.sh or boot-macOS.sh) to the following:
|
|
|
|
-netdev user,id=net0 -device e1000-82545em,netdev=net0,id=net0,mac=52:54:00:c9:18:27 \
|
|
|
|
No further setup is required; your internet should Just Werk™ in your virtual machine!
|
|
|
|
For further information on detailed configuration options, see QEMU's
|
|
documentation on networking ( http://wiki.qemu.org/Documentation/Networking )
|
|
|
|
-----------------------------------
|
|
Tap Networking (Better Performance)
|
|
-----------------------------------
|
|
|
|
Installing "virt-manager" automagically creates the "virbr0" local private bridge :-)
|
|
|
|
sudo apt-get install uml-utilities
|
|
sudo ip tuntap add dev tap0 mode tap
|
|
sudo ip link set tap0 up promisc on
|
|
sudo brctl addif virbr0 tap0
|
|
|
|
Add "-netdev tap,id=net0,ifname=tap0,script=no,downscript=no -device e1000-82545em,netdev=net0,id=net0,mac=52:54:00:c9:18:27 \"
|
|
to your qemu-system-x86_64 command.
|
|
|
|
QEMU networking tip
|
|
-------------------
|
|
|
|
# printf 'DE:AD:BE:EF:%02X:%02X\n' $((RANDOM%256)) $((RANDOM%256)) # generates QEMU compatible mac addresses!
|