Skip to content

Instantly share code, notes, and snippets.

@hyvanix
Last active May 1, 2021 15:29
Show Gist options
  • Save hyvanix/7d1d34534de1a6dc2622990102846924 to your computer and use it in GitHub Desktop.
Save hyvanix/7d1d34534de1a6dc2622990102846924 to your computer and use it in GitHub Desktop.
install centos under OmniOS via bhyve and the new zone administration tool 'zadm'
----------------------------
install zadm & illumos brand
----------------------------
global:# pkg install zadm brand/bhyve
--------------------------------------
create a zfs mountpoint to store zones
--------------------------------------
global:# zfs create -o mountpoint=/zones rpool/zones
-------------------
download centos iso
-------------------
global:# mkdir /zones/iso
global:# cd /zones/iso
global:# wget http://ftp.ps.pl/pub/Linux/CentOS/8.2.2004/isos/x86_64/CentOS-8.2.2004-x86_64-minimal.iso
-----------------------------
create zone config for centos
-----------------------------
global:# cd ~
global:# cat << EOF > centos-bhyve.json
{
"acpi" : "on",
"autoboot" : "false",
"bootargs" : "",
"bootorder" : "cd",
"cdrom" : "/zones/iso/CentOS-8.2.2004-x86_64-minimal.iso",
"bootdisk" : {
"blocksize" : "8K",
"path" : "rpool/centos",
"size" : "20G",
"sparse" : "false"
},
"bootrom" : "BHYVE_RELEASE",
"brand" : "bhyve",
"diskif" : "virtio",
"fs-allowed" : "",
"hostbridge" : "i440fx",
"hostid" : "",
"ip-type" : "exclusive",
"limitpriv" : "default",
"net" : [
{
"physical" : "centos0"
}
],
"netif" : "virtio",
"pool" : "",
"vnc" : "off",
"xhci" : "on",
"zonename" : "centos",
"zonepath" : "/zones/centos"
}
EOF
---------------------------
create centos virtual guest
---------------------------
global:# zadm create -b bhyve centos < centos-bhyve.json
A ZFS file system has been created for this zone.
global:# zadm start centos
global:# zlogin -C centos
[Connected to zone 'centos' console]
tada!
------------------
the difficult part
------------------
I have not used the vnc options in zadm therefore I will install centos via the text installer.
(note: the display the text output is not pretty and patience is required. \
It is probably also a good idea to issue the clear command before starting and logging into the zone.)
also I am not so familiar with centos text installer so this may not be the best way to do it
----------------------------------------------------------------------------------
It is needed to switch the installer to console mode so loose instructions follow:
----------------------------------------------------------------------------------
1. select 'Install CentOS Linux 8' & enter 'e' to edit this option
2. add 'console=ttys0' so it looks like the following
setparams 'Install CentOS Linux 8'
linuxefi /images/pxeboot/vmlinuz inst.stage2=hd:LABEL=CentOS-8-2-2004-\
x86_64-dvd quiet console=ttys0
initrdefi /images/pxeboot/initrd.img
then 'ctrl-x' to boot to console
---------------------------------
installing via the text installer
---------------------------------
from here you will enter the text installer
you will need to switch to the shell to mount the cdrom drive to make available to the installer
these two pages should help you navigate the installer:
https://docs.centos.org/en-US/centos/install-guide/Consoles_Logs_During_Install_x86/
https://docs.centos.org/en-US/centos/install-guide/adminoptions/
------------------------
post install maintenance
------------------------
after it is installed you need to halt the centos system and edit the zone and remove the 3 lines relating \
to the cdrom so as the new zone boots into the hdd
global:# zadm edit centos
delete 3 lines relating to cdrom here
---------------------------
and start up the zone again
---------------------------
global:# zadm start centos
global:# zlogin -C centos
[Connected to zone 'centos' console]
you will be soon presented with the centos login
tada!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment