Solved vm console <guest> gives Stale lock and will not break

vm console .... uses a serial port to connect to the VM. Lots of linux distrubutions don't enable the serial console, especially when you're using a graphical interface.
 
Code:
     ~^D or ~.
             Drop the connection and exit.  Only the connection is dropped –
             the login session is not terminated.
cu(1)
 
vm console .... uses a serial port to connect to the VM. Lots of linux distrubutions don't enable the serial console, especially when you're using a graphical interface.
I discovered that some time ago with CentOS7. The trick was to discover what modification is required to kernelopts to enable it.

Frankly, I do not see what benefit accrues to anyone from not making a serial console available by default. Instead, one must connect vmcviewer to the gui console. After connecting vncviewer to the guest then root is required to perform the equivalent of the following in the Linux vm so that vm-bhyve vm console will work:
Code:
# # create kernelopts update script for Rocky Linux 8 (RHEL-8 / CentOS-8)
# echo ' grub2-editenv - set " '  >  grub2_kernelopts.txt
# grub2-editenv - list  |  grep kernelopts  >>  grub2_kernelopts.txt
# echo ' console=tty0 console=ttyS0,115200" '  >>  grub2_kernelopts.txt
#
# # remove line endings
# tr -d "\n" < grub2_kernelopts.txt  > grub2_kernelopts.sh
# cat grub2_kernelopts.sh
 grub2-editenv - set " kernelopts=root=/dev/mapper/rl-root ro crashkernel=auto resume=/dev/mapper/rl-swap rd.lvm.lv=rl/root rd.lvm.lv=rl/swap console=tty0 console=ttyS0,115200"
#
# # update kernelopts
# bash grub2_kernelopts.sh
#

Originally it took me some time to figure out why vm console did not appear to work. And then more time to discover how to correct the omission.
 
Back
Top