[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-discuss] OSX options for DHCP address for Yocto VM
From: |
Peter Maydell |
Subject: |
Re: [Qemu-discuss] OSX options for DHCP address for Yocto VM |
Date: |
Thu, 28 Jan 2016 17:01:37 +0000 |
On 28 January 2016 at 16:35, Nathan Sowatskey <address@hidden> wrote:
> What I would like is to have a DHCP assigned address for the VM so that I can
> reach it from the host. I have tried the startup options below:
>
> /usr/local/bin/qemu-system-x86_64 -kernel images/bzImage-qemux86-64.bin -usb
> -netdev user,id=user.0 -device usb-net,netdev=user.0 -drive
> file=images/core-image-full-cmdline-qemux86-64.ext4,if=virtio,format=raw
> -show-cursor -no-reboot -m 256 -serial mon:vc -serial null --append "vga=0
> uvesafb.mode_option=640x480-32 root=/dev/vda rw mem=256M oprofile.timer=1
> rootfstype=ext4 “
>
> The options above, which I understood to equivalent to not specifying
> anything at all for netdev, do not give me a configured eth0. So, not what I
> need it seems.
The default network card for qemu-system-x86_64's PC model is not usb-net
(it's e1000), which is probably why you see this difference.
> And, with no netted options at all:
> The options above do give me a configured eth0, with an address
> taken from the Qemu DHCP address pool. That address, of 10.0.2.15
> as it happens, is not reachable from the OSX host though. So, close,
> but no cookie yet.
This is expected for usermode networking.
> Can anyone help me wth closing the gap so I can reach the VM from
> the OSX host please?
If you just need access to one or two ports (eg ssh) it may be
simplest just to use the user-mode networking's hostfwd option,
which will cause QEMU to forward connections from your host's
port X to guest port Y.
Otherwise you need to use a backend other than 'user'. This means
'tap', but this is largely tested and intended for a Linux host,
so you will have to do some googling to try to find out how to
set up tun/tap on OSX hosts and it might not work. (Even tun/tap
on Linux hosts requires a bit of setup.)
QEMU networking docs:
http://wiki.qemu.org/Documentation/Networking
thanks
-- PMM