Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

qemu driver using obsoleted -net syntax with vlan parameter #4

Closed
boydj opened this issue Mar 21, 2019 · 8 comments · Fixed by #6
Closed

qemu driver using obsoleted -net syntax with vlan parameter #4

boydj opened this issue Mar 21, 2019 · 8 comments · Fixed by #6

Comments

@boydj
Copy link

boydj commented Mar 21, 2019

if d.Network == "user" {
startCmd = append(startCmd,
"-net", "nic,vlan=0,model=virtio",
"-net", fmt.Sprintf("user,vlan=0,hostfwd=tcp::%d-:22,hostname=%s", d.SSHPort, d.GetMachineName()),
)
} else if d.Network == "tap" {
startCmd = append(startCmd,
"-net", "nic,vlan=0,model=virtio",
"-net", fmt.Sprintf("tap,vlan=0,ifname=%s,script=no,downscript=no", d.NetworkInterface),
)
} else if d.Network == "bridge" {
startCmd = append(startCmd,
"-net", "nic,vlan=0,model=virtio",
"-net", fmt.Sprintf("bridge,vlan=0,br=%s", d.NetworkBridge),
)

$ podman-machine create box -d qemu Running pre-create checks... Creating machine... (box) Copying /Users/joshboyd/.local/machine/cache/boot2podman.iso to /Users/joshboyd/.local/machine/machines/box/boot2podman.iso... (box) Creating SSH key... (box) Creating Disk image... (box) Starting QEMU VM... (box) OUTPUT: (box) ERROR: qemu-system-x86_64: Invalid parameter 'vlan'

$ qemu-system-x86_64 --version QEMU emulator version 3.1.0 Copyright (c) 2003-2018 Fabrice Bellard and the QEMU Project developers

@boydj boydj changed the title qemu driver using obsoleted -net syntax with vlan flag qemu driver using obsoleted -net syntax with vlan parameter Mar 21, 2019
@afbjorklund
Copy link
Contributor

Thanks for reporting! Apparently this should use -netdev rather than -net

https://wiki.qemu.org/Documentation/Networking#The_legacy_-net_option

Also the -net nic is now -device, and the vlan=0 parameter needs hubport ...

Same issue is probably relevant for machine-drivers/docker-machine-driver-qemu

@afbjorklund
Copy link
Contributor

This was changed in qemu 3.0: https://www.qemu.org/2018/05/31/nic-parameter/

Still using QEMU emulator version 2.5.0 (Debian 1:2.5+dfsg-5ubuntu10.34)

@dinamic
Copy link

dinamic commented Apr 23, 2019

Found out this is still not fixed in the most recent build.

~/Downloads$ podman-machine create box -d "qemu"
Creating CA: /Users/nikola/.local/machine/certs/ca.pem
Creating client certificate: /Users/nikola/.local/machine/certs/cert.pem
Running pre-create checks...
Creating machine...
(box) Image cache directory does not exist, creating it at /Users/nikola/.local/machine/cache...
(box) No default Boot2Podman ISO found locally, downloading the latest release...
(box) Latest release for github.com/boot2podman/boot2podman is v0.21
(box) Downloading /Users/nikola/.local/machine/cache/boot2podman.iso from https://github.com/boot2podman/boot2podman/releases/download/v0.21/boot2podman.iso...
(box) 0%....10%....20%....30%....40%....50%....60%....70%....80%....90%....100%
(box) Copying /Users/nikola/.local/machine/cache/boot2podman.iso to /Users/nikola/.local/machine/machines/box/boot2podman.iso...
(box) Creating SSH key...
(box) Creating Disk image...
(box) Starting QEMU VM...
(box) OUTPUT:
(box) ERROR: qemu-system-x86_64: Invalid parameter 'vlan'
(box)
Error performing create: Error creating machine: Error in driver during machine creation: exit status 1
~/Downloads$ podman-machine ls
NAME   ACTIVE   DRIVER   STATE     URL   ERRORS
box    -        qemu     Stopped
~/Downloads$ podman-machine start box
Starting "box"...
(box) OUTPUT:
(box) ERROR: qemu-system-x86_64: Invalid parameter 'vlan'
(box)
exit status 1
~/Downloads$ qemu-system-x86_64 --version
QEMU emulator version 3.1.0
Copyright (c) 2003-2018 Fabrice Bellard and the QEMU Project developers

@afbjorklund could we have a build that works with qemu 3.x, please?

@afbjorklund
Copy link
Contributor

Do you have a patch ? Or maybe could help translate the syntax, can add the versioning

@afbjorklund
Copy link
Contributor

Figured it out, eventually... Seems to work here ?

$ /opt/qemu/bin/qemu-system-x86_64 --version
QEMU emulator version 3.1.0
Copyright (c) 2003-2018 Fabrice Bellard and the QEMU Project developers

@afbjorklund
Copy link
Contributor

Thanks for trying podman-machine, hope that v0.15 works better for you.

https://github.com/boot2podman/machine/releases/tag/v0.15

@dinamic
Copy link

dinamic commented Apr 24, 2019

Great update! Thanks @afbjorklund!

@dinamic
Copy link

dinamic commented Apr 24, 2019

Just updated qemu on my macbook to 4.0.0 and I'm happy to report podman-machine works. :)

~$ qemu-system-x86_64 --version
QEMU emulator version 4.0.0
Copyright (c) 2003-2019 Fabrice Bellard and the QEMU Project developers
~$ podman-machine create box -d qemu
Running pre-create checks...
Creating machine...
(box) Copying /Users/nikola/.local/machine/cache/boot2podman.iso to /Users/nikola/.local/machine/machines/box/boot2podman.iso...
(box) Creating SSH key...
(box) Creating Disk image...
(box) Starting QEMU VM...
(box) Waiting for VM to start (ssh -p 52085 tc@localhost)...
Waiting for machine to be running, this may take a few minutes...
Detecting operating system of created instance...
Waiting for SSH to be available...
Detecting the provisioner...
Provisioning with boot2podman...
Copying certs to the local machine directory...
Copying certs to the remote machine...
Checking connection to Podman...
Podman is up and running!
To see how to connect your Podman client to Podman server running on this virtual machine, run: podman-machine env box
~$ podman-machine ls
NAME   ACTIVE   DRIVER   STATE     URL               ERRORS
box    -        qemu     Running   tcp://127.0.0.1
~$ podman-machine ssh box
        .---.        b o o t 2                 mm             https://podman.io
       /o   o\                                 ##
    __(=  "  =)__    ##m###m    m####m    m###m##  ####m##m   m#####m  ##m####m
     //\'-=-'/\\     ##"  "##  ##"  "##  ##"  "##  ## ## ##   " mmm##  ##"   ##
        )   (        ##    ##  ##    ##  ##    ##  ## ## ##  m##"""##  ##    ##
       /     \       ###mm##"  "##mm##"  "##mm###  ## ## ##  ##mmm###  ##    ##
  ____/  / \  \____  ## """      """"      """ ""  "" "" ""   """" ""  ""    ""
 `------'`"`'------' ##                                                art: jgs
tc@box:~$ id
uid=1001(tc) gid=50(staff) groups=50(staff)
tc@box:~$ uptime
 17:48:49 up 3 min,  2 users,  load average: 2.26, 1.88, 0.83
tc@box:~$

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants