2009年5月28日

qemu on Freebsd-7

qemu on Freebsd 7-stable:
please reference this article FreeBSDホストからQemuのゲストをtapでネットワークに接続する which saves life.

/boot/loader.conf:
kqemu_load="YES" # needed for qemu
if_bridge_load="YES" # needed for qemu
if_tap_load="YES" # needed for qemu

/etc/sysctl.conf:
net.link.tap.user_open=1
net.link.tap.up_on_open=1

/etc/devfs.conf:
own tap0 [yourname]:[yourgroupname]

/etc/devfs.rules:
[localrules=10]
add path 'tap*' mode 0660 group tap

/etc/rc.conf:
cloned_interfaces="bridge0"
ifconfig_fxp0="inet 192.168.3.2 netmask 255.255.255.0"
ifconfig_bridge0="addm fxp0"
devfs_system_ruleset="localrules"

/etc/devd.conf:
notify 100 {
match "system" "IFNET";
match "subsystem" "tap[0-9]+";
match "type" "ATTACH";
action "/sbin/ifconfig bridge0 addm $subsystem";
};
notify 100 {
match "system" "IFNET";
match "subsystem" "tap[0-9]+";
match "type" "DETACH";
action "/sbin/ifconfig bridge0 deletem $subsystem";
};


> qemu -hda freebsd.img -net nic -net tap,ifname=tap,script=no

沒有留言: