|
|
How to make a virtual network with qemu
This documents some caveats to make a virtual network with qemu.
Dependencies
- vde (use nexedi's rpm)
- qemu (better with kqemu)
Procedures
- Run
vde_switch.
- Run
slirpvde -d -n 192.168.254.0. -d is required only if a dhcp server is used.
- Run
QEMU_TMPDIR=~/tmp vdeq /usr/local/bin/qemu -cdrom foo.iso -m 256 -macaddr 52:54:00:12:34:??
Caveats
- If kqemu is built into qemu, qemu creates a big file under /dev/shm by default. If multiple qemu instances are executed, qemu can easily make the tmpfs full. Note that the default max size of tmpfs is a half of real memory. So it is better to specify somewhere on a disk by the environment variable
QEMU_TMPDIR.
- It is better to specify the location of qemu to vdeq explicitly.
- Do not forget to specify an unique mac addr to each qemu instance. qemu does not generate a unique one automatically.
- If it is necessary to connect qemu to real networks, a tap device must be used for vde. This requires a root permission.
|