Unable to build qemu image using vyos-build docker container


#1

I’m running into an issue trying to build the qemu image inside the vyos-build docker container. Starting with a Debian 9 VM, I had no issues building the docker container, then building the ISO using ‘make iso’. Trying to build the qemu image after that fails though, relevant output below:

root@58c2693b0528:/vyos# make qemu
Checking if packages required for VyOS image build are installed
All dependencies are installed
qemu-image output will be in this color.

==> qemu-image: Retrieving ISO
    qemu-image: Using file in-place: file:///vyos/build/live-image-amd64.hybrid.iso
==> qemu-image: Creating hard drive...
==> qemu-image: Found port for communicator (SSH, WinRM, etc): 2225.
==> qemu-image: Looking for available port between 5900 and 6000 on 127.0.0.1
==> qemu-image: Starting VM, booting from CD-ROM
    qemu-image: The VM will be run headless, without a GUI. If you want to
    qemu-image: view the screen of the VM, connect via VNC without a password to
    qemu-image: vnc://127.0.0.1:5969
==> qemu-image: Waiting 5s for boot...
==> qemu-image: Connecting to VM via VNC (127.0.0.1:5969)
==> qemu-image: Typing the boot command over VNC...
==> qemu-image: Using ssh communicator to connect: 127.0.0.1
==> qemu-image: Waiting for SSH to become available...
==> qemu-image: Timeout waiting for SSH.
==> qemu-image: Deleting output directory...
Build 'qemu-image' errored: Timeout waiting for SSH.

==> Some builds didn't complete successfully and had errors:
--> qemu-image: Timeout waiting for SSH.

==> Builds finished but no artifacts were created.
Makefile:47: recipe for target 'qemu' failed
make: *** [qemu] Error 1

I can provide the full list of commands used to get here, but they pretty much mirror the instructions in the github repo. I had the same results in a local VM and a cloud VM. I haven’t tried using a different docker host OS, but I can’t see why that should matter.

I’m also unable to build the GCE target, but that can get its own topic, since I don’t think its related to this error.

I’m up for contributing some documentation on building images using the vyos-build docker container if I can get this all working.


#2

My in-progress documentation, which also serves as instructions to reproduce the above issue is here: https://wiki.vyos.net/wiki/Building_images_using_vyos-build_Docker_container


#3

I figured this one out - the timing was a little too tight in the packer script, at least on my machine. I slowed a few of the steps down and got a successful build. Not sure if this is actually a bug, per se, since the performance is going to be machine dependant - but at least on the 4 machines I tried, the existing timing is too short.

Here’s the boot_command section of my edited packer.json:

"<enter><wait4m>",
"vyos<enter><wait5>",
"vyos<wait><enter><wait10>",
"install image<enter><wait5>",
"<enter><wait5>",
"<enter><wait5>",
"<enter><wait5>",
"Yes<enter><wait5>",
"<enter><wait15>",
"<enter><wait5>",
"<enter><wait20>",
"vyos<enter><wait5>",
"vyos<enter><wait10>",
"<enter><wait10><wait10>",
"reboot<enter><wait5>",
"Yes<enter><wait4m>",
"vyos<enter><wait5>",
"vyos<enter><wait10>",
"configure<enter><wait10>",
"set interface ethernet eth0 address dhcp<enter><wait20>",
"set service ssh<enter><wait5>",
"commit<enter><wait30>",
"save<enter><wait5>",
"delete interface ethernet eth0 hw-id<enter><wait5>",
"commit<enter><wait30>",
"save<enter><wait5>",
"exit<enter><wait5>"

Some of the timing is probably a little slower than it needs to be, but I don’t think I waste more than a few minutes. I can submit a pull request with these changes if the devs are interested.


#4

That worked for me. Thank you.


closed #5

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.