[Ubuntu 18.04.2] Receiving "error: no such device: root" in VirtualBox/ESXi with converted from qcow2 to vmdk on cloud .img, with Packer qemu builder

55 views
Skip to first unread message

Dayman Cash

unread,
Aug 1, 2019, 10:53:23 PM8/1/19
to Packer
Is anyone familiar with initial booting issues in Virtual Box/ESXi hosts with Ubuntu 18.04 initiated from Packer? We are migrating from 14.04/16.04 cloud images which have always worked fine end to end. Using qemu version 4.0.0, Packer 1.4.2, on Ubuntu 16.04. The image work sequence is: .img read into packer, booted and exported to qcow2, then converted to vmdk with "qemu-img convert" (qemu-img convert -f qcow2 -O vmdk -o subformat=streamOptimized packer_img.qcow2 packer_img.vmdk).

Here's a snippet of the json packer file:

  "builders": [{

    "type": "qemu",

    "iso_url": "ubuntu-18.04.2-server-cloudimg-amd64.img",

    "iso_checksum": "aa5bbaf6a3ec34001dc43b10de62d304bb6e956b262e85f554b2fed0e1250714",

    "iso_checksum_type": "sha256",

    "disk_image": true,

    "output_directory": "{{user `output_directory`}}",

    "disk_size": 10000,

    "format": "qcow2",

    "disk_compression": false,

    "headless": true,

    "accelerator": "kvm",

    "ssh_username": "{{user `username`}}",

    "ssh_password": "{{user `username`}}",

    "ssh_port": 22,

    "ssh_wait_timeout": "{{user `ssh_timeout`}}",

    "vm_name": "{{user `image_name`}}",

    "use_default_display": true,

    "shutdown_command": "sudo shutdown -h now",

    "qemuargs": [

      ["-m", "4096M"],

      ["-smp", "4"],

      ["-cdrom", "cloud.img"],

      ["-smbios", "type=1,serial=ds=nocloud"],

      ["-serial", "mon:stdio"]

    ]

  }],

  "provisioners": [{

    "type": "shell",

    "inline": [

      "while [ ! -f /var/lib/cloud/instance/boot-finished ]; do echo 'Waiting for cloud-init...'; sleep 1; done",

      "ssh-keyscan github.com >> /home/{{user `username`}}/.ssh/known_hosts"

    ]

  },

Rickard von Essen

unread,
Aug 2, 2019, 3:46:08 AM8/2/19
to packe...@googlegroups.com
Could you provide some more details. I guess this is because the disk is connected in a different way making it appear as a different device.

Some things to check:
Where is this error comming from, VirtualBox or the Linux kernel trying to mount the boot dev?

Can you show grub.conf, etc
Kernel arguments

Vmdk configuration, how is the disk configured? 

What device is this when running on Qemu and on VirtualBox? 

--
This mailing list is governed under the HashiCorp Community Guidelines - https://www.hashicorp.com/community-guidelines.html. Behavior in violation of those guidelines may result in your removal from this mailing list.
 
GitHub Issues: https://github.com/mitchellh/packer/issues
IRC: #packer-tool on Freenode
---
You received this message because you are subscribed to the Google Groups "Packer" group.
To unsubscribe from this group and stop receiving emails from it, send an email to packer-tool...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/packer-tool/d5b0264f-51b3-4c87-8d70-e0f2334c1d1f%40googlegroups.com.

Dayman Cash

unread,
Aug 12, 2019, 3:23:39 PM8/12/19
to Packer
Hi Rickard, thanks for the response, my apologies for the delayed response.

I have traced the root cause, which dealt with the sensitivity of the UUID impacting the boot loader by setting GRUB_DISABLE_LINUX_UUID=true inside of /etc/default/grub. The boot loader now functions as intended. Thanks again.

Dayman

To unsubscribe from this group and stop receiving emails from it, send an email to packe...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages