1

I am attempting to create a custom image from Ubuntu Cloud image, specifically https://cloud-images.ubuntu.com/minimal/releases/impish/release/ubuntu-21.10-minimal-cloudimg-amd64.img

Using virsh vncdisplay and VNC Viewer I only get the initial boot output from grub but not the OS console.

Everything else works fine except for the VNC console display. I had thought that I need to set the serial output for the console but that didn't seem to help either. During image create I modify GRUB_CMDLINE_LINUX_DEFAULT

#!/bin/bash

KERNEL_OPTIONS=(
 'console=tty1'
 'console=ttyS0,115200n8'
)


#Replace default cmdline args with KERNEL_OPTIONS, to redirect logs to serial console
sudo sed -i -e \
    "s/.*GRUB_CMDLINE_LINUX_DEFAULT=\"\(.*\)\"/GRUB_CMDLINE_LINUX_DEFAULT=\"${KERNEL_OPTIONS[*]}\"/" \
    /etc/default/grub.d/50-cloudimg-settings.cfg

#Update grub to persist the change
sudo update-grub

Has anyone gotten vnc console display working with Ubuntu cloud images?

enter image description here

1 Answer 1

0

You need to set up a serial console for the VM. This can be done by adding the following to your VM's XML definition:

<serial type='pty'>
  <target port='0'/>
</serial>

<console type='pty' tty='/dev/pts/1'>
  <source path='/dev/pts/1'/>
  <target type='serial' port='0'/>
</console>

You will also need to add the following to your /etc/default/grub file:

GRUB_CMDLINE_LINUX_DEFAULT="console=tty1 console=ttyS0,115200n8"

After that, you should be able to see the console output in your VNC viewer.

2
  • right, that's the point of the grub edit script I provided above. It looks to be applied and just to be clear I do get output from the vnc display, just not the OS output. Commented Jun 28, 2022 at 0:28
  • have you done this with an ubuntu "cloud image" as a starting point for your custom image? I already have the settings applied that you suggested and I do actually get the console output from VNC but it's only the grub boot output. In other words, the login prompt is not accessible which is what I am expecting. Commented Jun 28, 2022 at 12:52

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .