boot2podman / machine

Apache License 2.0
120 stars 16 forks source link

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

Closed boydj closed 5 years ago

boydj commented 5 years ago

https://github.com/boot2podman/machine/blob/fae6764ac9630facfac084fb88984ffafd8840b2/drivers/qemu/qemu.go#L457-L471

$ 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

afbjorklund commented 5 years ago

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 commented 5 years ago

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 commented 5 years ago

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 commented 5 years ago

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

afbjorklund commented 5 years ago

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 commented 5 years ago

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

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

dinamic commented 5 years ago

Great update! Thanks @afbjorklund!

dinamic commented 5 years ago

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:~$