Register for the iXsystems Community to get an ad-free experience and exclusive discounts in our eBay Store.

SOLVED Quick guide to install CentOS 8 in bhyve with the serial console

Western Digital Drives - The Preferred Drives of FreeNAS and TrueNAS CORE

blanchet

Senior Member
Joined
Apr 17, 2018
Messages
349
Abstract
To have a lighter Linux virtual machine, you can enable the serial console and then remove the VNC device after the operating system installation with VNC.
But do you know that you can directly run the CentOS 8 installer on the serial console without VNC ?
It is faster because you will not have to enable the serial console after the operating system installation.



Install CentOS 8 with the serial console in bhyve
Open the VM creation wizard
Code:
1/ Operating System
  Guest Operating System: Linux
  Name: my_centos_server
  Description: centos server in serial mode
  System clock: Local
  Boot Method: UEFI
  [x] Start on Boot
  [_] Enable VNC

2/ CPU and Memory
  Virtual CPUs: 1
  Memory: 2 GiB

3/ Disks
  (o) Create new disk
  Select Disk Type: Virtio
  zvol location: tank1
  Size: 10 GiB

4/ Network Interface
  Adapter type:  VirtIo
  Mac Address: <autogenerated>
  Attach NIC: <select you NIC>

5/ Installation Media
  /mnt/tank1/iso/CentOS-8.1.1911-x86_64-dvd1.iso

6/ Confirm Options
SUBMIT


Return to the VM list
  • Open COLUMNS menu to display the Com Port of your new virtual machine and note it.
  • For example /dev/nmdm20B
From your Linux PC
  • run xterm , because it interprets neither keys (F1, F2, etc) nor shorcuts unlike gnome-terminal
  • connect with SSH to FreeNAS
    • from a Windows computer, you can use PuTTY instead of xterm + ssh
  • in the FreeNAS shell, connect to the virtual serial port of the virtual machine
    • The FreeNAS webUI supports also the serial console, but it is not as reliable as xterm or PuTTY
Code:
freenas# cu -l /dev/nmdm20B


Keep open the xterm window while powering on the VM
  • Go to the line Install CentOS Linux 8
  • Press e to edit the command line
  • Modify the vmlinuz line to replace quiet by console=ttyS0,115200n8
  • Example
Code:
linuxefi /images/pxeboot/vmlinuz inst.stage2=hd:LABEL=CentOS-8-1-1911-x86_64-dvd console=ttyS0,115200n8

  • Hit CTRL+X to boot
The installer will run in text mode. It is minimalist (it offers less options than the graphical installer) but it works.

At the end of the installation
  • Power off the VM
  • Remove the CDROM device from the VM
  • Power on the VM
  • GRUB appears and the system boots
  • Login as root and enjoy your new CentOS 8 Linux server with a serial console.
 
Top