So you have the VM interface and the host interface on a bridge: dhclient on the host "steals" all DHCP packets via BPF.
Try to pkill dhclient on the host and the VM should be able to get DHCP. There is currently no solution for that, it is the way our dhclient works, you can try to run the VM on a NAT'ed bridge or use "-L" local interfaces. Reyk > On 04.05.2017, at 14:51, Francois Stephany <franc...@tamere.eu> wrote: > > Hi, > > I'm new to OpenBSD and I'm trying a simple setup where a VMM guest has > access to the network via tap and bridge. The host uses a wired connection > and gets its network address with DHCP. > > Here's my /etc/vm.conf: > > switch "vms_switch" { > interface bridge0 > add bge0 > } > > vm "vm.test" { > memory 1G > boot /home/fstephany/bsd.rd > disk /var/vms/fstephany/vmtest-disk.img > owner fstephany > interface tap { > switch "vms_switch" > } > disable > } > > > I've stopped vmd with #rcctl stop vmd > and started it manually: > > # vmd -dvv > startup > /etc/vm.conf:4: switch "vms_switch" registered > /etc/vm.conf:15: vm "vm.test" registered (disabled) > vm_priv_brconfig: interface bridge0 description switch1-vms_switch > vm_priv_brconfig: interface bridge0 add bge0 > vmd_configure: not creating vm vm.test (disabled) > vm_opentty: vm vm.test tty /dev/ttyp1 uid 0 gid 4 mode 620 > vm_priv_ifconfig: interface tap0 description vm1-if0-vm.test > vm_priv_ifconfig: interface bridge0 add tap0 > vm.test: started vm 1 successfully, tty /dev/ttyp1 > loadfile_elf: loaded ELF kernel > run_vm: initializing hardware for vm vm.test > virtio_init: vm "vm.test" vio0 lladdr fe:e1:bb:d1:6d:23 > run_vm: starting vcpu threads for vm vm.test > vcpu_reset: resetting vcpu 0 for vm 5 > run_vm: waiting on events for VM vm.test > i8259_write_datareg: master pic, reset IRQ vector to 0x20 > i8259_write_datareg: slave pic, reset IRQ vector to 0x28 > vcpu_exit_i8253: channel 0 reset, mode=7, start=11932 > virtio_blk_io: device reset > virtio_net_io: device reset > vionet queue notify - no space, dropping packet > vionet queue notify - no space, dropping packet > vionet queue notify - no space, dropping packet > vionet queue notify - no space, dropping packet > vionet queue notify - no space, dropping packet > virtio_net_io: device reset > > > Here's what happens when the installer tries to get a network address: > > # vmctl status > ID PID VCPUS MAXMEM CURMEM TTY OWNER NAME > 1 - 1 1.0G - - fstephany vm.test > # vmctl start vm.test -c > Connected to /dev/ttyp1 (speed 9600) > > Copyright (c) 1982, 1986, 1989, 1991, 1993 > The Regents of the University of California. All rights reserved. > Copyright (c) 1995-2017 OpenBSD. All rights reserved. > https://www.OpenBSD.org > > OpenBSD 6.1-current (RAMDISK_CD) #41: Tue May 2 21:13:30 MDT 2017 > dera...@amd64.openbsd.org:/usr/src/sys/arch/amd64/compile/RAMDISK_CD > real mem = 1056964608 (1008MB) > avail mem = 1021235200 (973MB) > mainbus0 at root > bios0 at mainbus0 > acpi at bios0 not configured > cpu0 at mainbus0: (uniprocessor) > cpu0: Intel(R) Celeron(R) CPU G1610T @ 2.30GHz, 2295.33 MHz > cpu0: > FPU,VME,DE,PSE,MSR,PAE,MCE,CX8,SEP,PGE,MCA,CMOV,PSE36,CFLUSH,MMX,FXSR,SSE,SSE2,SSE3,PCLMUL,SSSE3,CX16,SSE4.1,SSE4.2,POPCNT,XSAVE,HV,NXE,LONG,LAHF,FSGSBASE,SMEP,ERMS > cpu0: 256KB 64b/line 8-way L2 cache > pvbus0 at mainbus0: OpenBSD > pci0 at mainbus0 bus 0 > pchb0 at pci0 dev 0 function 0 "OpenBSD VMM Host" rev 0x00 > virtio0 at pci0 dev 1 function 0 "Qumranet Virtio RNG" rev 0x00 > viornd0 at virtio0 > virtio0: irq 3 > virtio1 at pci0 dev 2 function 0 "Qumranet Virtio Storage" rev 0x00 > vioblk0 at virtio1 > scsibus0 at vioblk0: 2 targets > sd0 at scsibus0 targ 0 lun 0: <VirtIO, Block Device, > SCSI3 0/direct fixed > sd0: 4096MB, 512 bytes/sector, 8388608 sectors > virtio1: irq 5 > virtio2 at pci0 dev 3 function 0 "Qumranet Virtio Network" rev 0x00 > vio0 at virtio2: address fe:e1:bb:d1:6d:23 > virtio2: irq 7 > virtio3 at pci0 dev 4 function 0 "OpenBSD VMM Control" rev 0x00 > virtio3: no matching child driver; not configured > isa0 at mainbus0 > com0 at isa0 port 0x3f8/8 irq 4: ns8250, no fifo > com0: console > softraid0 at root > scsibus1 at softraid0: 256 targets > root on rd0a swap on rd0b dump on rd0b > > erase ^?, werase ^W, kill ^U, intr ^C, status ^T > > Welcome to the OpenBSD/amd64 6.1 installation program. > (I)nstall, (U)pgrade, (A)utoinstall or (S)hell? I > At any prompt except password prompts you can escape to a shell by > typing '!'. Default answers are shown in []'s and are selected by > pressing RETURN. You can exit this program at any time by pressing > Control-C, but this can leave your system in an inconsistent state. > > Terminal type? [vt220] > System hostname? (short form, e.g. 'foo') vmtest > > Available network interfaces are: vio0 vlan0. > Which network interface do you wish to configure? (or 'done') [vio0] > IPv4 address for vio0? (or 'dhcp' or 'none') [dhcp] > DHCPDISCOVER on vio0 - interval 1 > DHCPDISCOVER on vio0 - interval 2 > DHCPDISCOVER on vio0 - interval 2 > DHCPDISCOVER on vio0 - interval 2 > DHCPDISCOVER on vio0 - interval 2 > DHCPDISCOVER on vio0 - interval 2 > No acceptable DHCPOFFERS received. > No working leases in persistent database - sleeping. > IPv6 address for vio0? (or 'autoconf' or 'none') [none] > > > Here's ifconfig when the VM is running. The bridge is there with bge0 and > tap0: > > # ifconfig > lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> mtu 32768 > index 4 priority 0 llprio 3 > groups: lo > inet6 ::1 prefixlen 128 > inet6 fe80::1%lo0 prefixlen 64 scopeid 0x4 > inet 127.0.0.1 netmask 0xff000000 > bge0: flags=8b43<UP,BROADCAST,RUNNING,PROMISC,ALLMULTI,SIMPLEX,MULTICAST> > mtu 1500 > lladdr 00:fd:45:fc:00:fc > index 1 priority 0 llprio 3 > groups: egress > media: Ethernet autoselect (1000baseT full-duplex,rxpause,txpause) > status: active > inet 192.168.0.9 netmask 0xffffff00 broadcast 192.168.0.255 > bge1: flags=8802<BROADCAST,SIMPLEX,MULTICAST> mtu 1500 > lladdr 00:fd:45:fc:00:fd > index 2 priority 0 llprio 3 > media: Ethernet autoselect (none) > status: no carrier > enc0: flags=0<> > index 3 priority 0 llprio 3 > groups: enc > status: active > pflog0: flags=141<UP,RUNNING,PROMISC> mtu 33136 > index 5 priority 0 llprio 3 > groups: pflog > bridge0: flags=41<UP,RUNNING> > description: switch1-vms_switch > index 6 llprio 3 > groups: bridge > priority 32768 hellotime 2 fwddelay 15 maxage 20 holdcnt 6 proto > rstp > bge0 flags=3<LEARNING,DISCOVER> > port 1 ifpriority 0 ifcost 0 > tap0 flags=3<LEARNING,DISCOVER> > port 13 ifpriority 0 ifcost 0 > tap0: flags=8943<UP,BROADCAST,RUNNING,PROMISC,SIMPLEX,MULTICAST> mtu 1500 > lladdr fe:e1:ba:d6:54:17 > description: vm1-if0-vm.test > index 13 priority 0 llprio 3 > groups: tap > status: active > > > Any idea of what I'm doing wrong? > Thanks! > > > I'm running SNAPSHOT from yesterday: > > # dmesg > OpenBSD 6.1-current (GENERIC.MP) #48: Wed May 3 17:09:45 MDT 2017 > dera...@amd64.openbsd.org:/usr/src/sys/arch/amd64/compile/GENERIC.MP > real mem = 4242419712 (4045MB) > avail mem = 4108054528 (3917MB) > mpath0 at root > scsibus0 at mpath0: 256 targets > mainbus0 at root > bios0 at mainbus0: SMBIOS rev. 2.7 @ 0xf3bdb000 (64 entries) > bios0: vendor HP version "J06" date 11/02/2015 > bios0: HP ProLiant MicroServer Gen8 > acpi0 at bios0: rev 2 > acpi0: sleep states S0 S4 S5 > acpi0: tables DSDT FACP SPCR MCFG HPET FFFF SPMI ERST APIC FFFF BERT HEST > FFFF FFFF SSDT SSDT SSDT SSDT SSDT > acpi0: wakeup devices PCI0(S4) > acpitimer0 at acpi0: 3579545 Hz, 24 bits > acpimcfg0 at acpi0 addr 0xf4000000, bus 0-63 > acpihpet0 at acpi0: 14318179 Hz > acpimadt0 at acpi0 addr 0xfee00000: PC-AT compat > cpu0 at mainbus0: apid 0 (boot processor) > cpu0: Intel(R) Celeron(R) CPU G1610T @ 2.30GHz, 2295.12 MHz > cpu0: > FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CFLUSH,DS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,PBE,SSE3,PCLMUL,DTES64,MWAIT,DS-CPL,VMX,EST,TM2,SSSE3,CX16,xTPR,PDCM,PCID,SSE4.1,SSE4.2,POPCNT,DEADLINE,XSAVE,NXE,RDTSCP,LONG,LAHF,PERF,ITSC,FSGSBASE,SMEP,ERMS,SENSOR,ARAT > cpu0: 256KB 64b/line 8-way L2 cache > cpu0: TSC frequency 2295119800 Hz > cpu0: smt 0, core 0, package 0 > mtrr: Pentium Pro MTRR support, 10 var ranges, 88 fixed ranges > cpu0: apic clock running at 99MHz > cpu0: mwait min=64, max=64, C-substates=0.2.1.1, IBE > cpu1 at mainbus0: apid 2 (application processor) > cpu1: Intel(R) Celeron(R) CPU G1610T @ 2.30GHz, 2294.79 MHz > cpu1: > FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CFLUSH,DS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,PBE,SSE3,PCLMUL,DTES64,MWAIT,DS-CPL,VMX,EST,TM2,SSSE3,CX16,xTPR,PDCM,PCID,SSE4.1,SSE4.2,POPCNT,DEADLINE,XSAVE,NXE,RDTSCP,LONG,LAHF,PERF,ITSC,FSGSBASE,SMEP,ERMS,SENSOR,ARAT > cpu1: 256KB 64b/line 8-way L2 cache > cpu1: smt 0, core 1, package 0 > ioapic0 at mainbus0: apid 8 pa 0xfec00000, version 20, 24 pins > acpiprt0 at acpi0: bus 13 (IPT1) > acpiprt1 at acpi0: bus -1 (IPT2) > acpiprt2 at acpi0: bus -1 (IPT3) > acpiprt3 at acpi0: bus -1 (IPT4) > acpiprt4 at acpi0: bus 3 (IPT5) > acpiprt5 at acpi0: bus -1 (IPT6) > acpiprt6 at acpi0: bus 4 (IPT7) > acpiprt7 at acpi0: bus 1 (IPT8) > acpiprt8 at acpi0: bus 7 (PT02) > acpiprt9 at acpi0: bus -1 (PT03) > acpiprt10 at acpi0: bus 2 (PT05) > acpiprt11 at acpi0: bus 0 (PCI0) > acpicpu0 at acpi0: C2(350@96 mwait.1@0x20), C1(1000@1 mwait.1) > acpicpu1 at acpi0: C2(350@96 mwait.1@0x20), C1(1000@1 mwait.1) > acpitz0 at acpi0: critical temperature is 31 degC > "IPI0001" at acpi0 not configured > "PNP0A06" at acpi0 not configured > "PNP0303" at acpi0 not configured > "PNP0F13" at acpi0 not configured > "ACPI000D" at acpi0 not configured > ipmi at mainbus0 not configured > pci0 at mainbus0 bus 0 > pchb0 at pci0 dev 0 function 0 "Intel Core 3G Host" rev 0x09 > ppb0 at pci0 dev 1 function 0 "Intel Core 3G PCIE" rev 0x09: msi > pci1 at ppb0 bus 7 > ppb1 at pci0 dev 6 function 0 "Intel Core 3G PCIE" rev 0x09: msi > pci2 at ppb1 bus 2 > ehci0 at pci0 dev 26 function 0 "Intel 6 Series USB" rev 0x05: apic 8 int 21 > usb0 at ehci0: USB revision 2.0 > uhub0 at usb0 configuration 1 interface 0 "Intel EHCI root hub" rev > 2.00/1.00 addr 1 > ppb2 at pci0 dev 28 function 0 "Intel 6 Series PCIE" rev 0xb5 > pci3 at ppb2 bus 13 > ppb3 at pci0 dev 28 function 4 "Intel 6 Series PCIE" rev 0xb5 > pci4 at ppb3 bus 3 > bge0 at pci4 dev 0 function 0 "Broadcom BCM5720" rev 0x00, BCM5720 A0 > (0x5720000), APE firmware NCSI 1.3.16.0: msi, address 00:fd:45:fc:00:fc > brgphy0 at bge0 phy 1: BCM5720C 10/100/1000baseT PHY, rev. 0 > bge1 at pci4 dev 0 function 1 "Broadcom BCM5720" rev 0x00, BCM5720 A0 > (0x5720000), APE firmware NCSI 1.3.16.0: msi, address 00:fd:45:fc:00:fd > brgphy1 at bge1 phy 2: BCM5720C 10/100/1000baseT PHY, rev. 0 > ppb4 at pci0 dev 28 function 6 "Intel 6 Series PCIE" rev 0xb5 > pci5 at ppb4 bus 4 > xhci0 at pci5 dev 0 function 0 "Renesas uPD720201 xHCI" rev 0x03: msi > usb1 at xhci0: USB revision 3.0 > uhub1 at usb1 configuration 1 interface 0 "Renesas xHCI root hub" rev > 3.00/1.00 addr 1 > ppb5 at pci0 dev 28 function 7 "Intel 6 Series PCIE" rev 0xb5 > pci6 at ppb5 bus 1 > "Hewlett-Packard iLO3 Slave" rev 0x05 at pci6 dev 0 function 0 not > configured > vga1 at pci6 dev 0 function 1 "Matrox MGA G200eH" rev 0x00 > wsdisplay0 at vga1 mux 1: console (80x25, vt100 emulation) > wsdisplay0: screen 1-5 added (80x25, vt100 emulation) > "Hewlett-Packard iLO3 Management" rev 0x05 at pci6 dev 0 function 2 not > configured > uhci0 at pci6 dev 0 function 4 "Hewlett-Packard USB" rev 0x02: apic 8 int 16 > usb2 at uhci0: USB revision 1.0 > uhub2 at usb2 configuration 1 interface 0 "Hewlett-Packard UHCI root hub" > rev 1.00/1.00 addr 1 > ehci1 at pci0 dev 29 function 0 "Intel 6 Series USB" rev 0x05: apic 8 int 20 > usb3 at ehci1: USB revision 2.0 > uhub3 at usb3 configuration 1 interface 0 "Intel EHCI root hub" rev > 2.00/1.00 addr 1 > ppb6 at pci0 dev 30 function 0 "Intel 82801BA Hub-to-PCI" rev 0xa5 > pci7 at ppb6 bus 20 > pcib0 at pci0 dev 31 function 0 "Intel C204 LPC" rev 0x05 > ahci0 at pci0 dev 31 function 2 "Intel 6 Series AHCI" rev 0x05: msi, AHCI > 1.3 > ahci0: port 0: 6.0Gb/s > ahci0: port 1: 6.0Gb/s > scsibus1 at ahci0: 32 targets > sd0 at scsibus1 targ 0 lun 0: <ATA, ST2000DM001-1ER1, CC26> SCSI3 0/direct > fixed naa.5000c50092d6a34b > sd0: 1907729MB, 512 bytes/sector, 3907029168 sectors > sd1 at scsibus1 targ 1 lun 0: <ATA, ST2000DM001-1ER1, CC26> SCSI3 0/direct > fixed naa.5000c50092d69c0e > sd1: 1907729MB, 512 bytes/sector, 3907029168 sectors > isa0 at pcib0 > isadma0 at isa0 > com1 at isa0 port 0x2f8/8 irq 3: ns16550a, 16 byte fifo > com1: probed fifo depth: 0 bytes > pckbc0 at isa0 port 0x60/5 irq 1 irq 12 > pckbd0 at pckbc0 (kbd slot) > wskbd0 at pckbd0: console keyboard, using wsdisplay0 > pcppi0 at isa0 port 0x61 > spkr0 at pcppi0 > vmm0 at mainbus0: VMX/EPT > uhub4 at uhub0 port 1 configuration 1 interface 0 "Intel Rate Matching Hub" > rev 2.00/0.00 addr 2 > umass0 at uhub4 port 3 configuration 1 interface 0 "TOSHIBA TransMemory" > rev 2.00/1.00 addr 3 > umass0: using SCSI over Bulk-Only > scsibus2 at umass0: 2 targets, initiator 0 > sd2 at scsibus2 targ 1 lun 0: <TOSHIBA, TransMemory, PMAP> SCSI2 0/direct > removable serial.09306545ED90A000E2F6 > sd2: 29774MB, 512 bytes/sector, 60978816 sectors > uhub5 at uhub3 port 1 configuration 1 interface 0 "Intel Rate Matching Hub" > rev 2.00/0.00 addr 2 > uhub6 at uhub5 port 3 configuration 1 interface 0 "Standard Microsystems > product 0x2660" rev 2.00/8.01 addr 3 > vscsi0 at root > scsibus3 at vscsi0: 256 targets > softraid0 at root > scsibus4 at softraid0: 256 targets > sd3 at scsibus4 targ 1 lun 0: <OPENBSD, SR RAID 1, 006> SCSI2 0/direct fixed > sd3: 1907726MB, 512 bytes/sector, 3907023473 sectors > root on sd2a (8d8c13786c7b84d3.a) swap on sd2b dump on sd2b