curl https://releases.ubuntu.com/22.04/ubuntu-22.04.1-desktop-amd64.iso -o ubuntu-22.04.1-desktop-amd64.iso
dd
(dd
example below)This could destroy your system if you flash to the wrong drive! Identify your flash drive first. The hash at the start of the command here is for safety purposes if your are copy/pasting. You must fist edit the command and remove the hash in order to run it!
# sudo dd if=ubuntu-22.04.1-desktop-amd64.iso of=/dev/sdx bs=1024k status=progress
apt
sudo apt install -y qemu-kvm virt-manager libvirt-daemon-system virtinst libvirt-clients \
bridge-utils zsys cockpit cockpit-machines net-tools openssh-server \
zsh software-properties-common curl git libnss3-tools jq xsel xrdp
NOTE: Alternatively, you may first want to simply install openssh-server in the graphical environment, then do the rest over ssh, so that you can copy/paste.
echo "${USER} ALL=(ALL) NOPASSWD: ALL" |sudo tee -a /etc/sudoers
zsh
with oh-my-zsh and syntax highlighting and autocompletionsh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
git clone https://github.com/zsh-users/zsh-autosuggestions.git $ZSH_CUSTOM/plugins/zsh-autosuggestions \
&& git clone https://github.com/larkery/zsh-histdb $HOME/.oh-my-zsh/custom/plugins/zsh-histdb \
&& git clone https://github.com/zsh-users/zsh-syntax-highlighting.git $ZSH_CUSTOM/plugins/zsh-syntax-highlighting \
&& sed -i '/plugins=(git)/c\plugins=(git zsh-autosuggestions zsh-syntax-highlighting)' ~/.zshrc \
&& source ~/.zshrc
/etc/gdm3/custom.conf
sudo nano /etc/gdm3/custom.conf
uncomment WaylandEnabled=false
/etc/default/grub
sudo nano /etc/default/grub
GRUB_CMDLINE_LINUX_DEFAULT="intel_iommu=on"
sudo update-grub
etc/modules
sudo nano /etc/modules
Add the following modules:
vfio
vfio_iommu_type1
vfio_pci
vfio_virqfd
This requires a discrete Sata controller, and a seperate drive/controller for the host. The board being used in this example has a sata controller and a seperate nvme drive. The ubuntu host is installed on the nvme drive, on which the default libvirt pool will also be used to store the image for the TrueNAS VM’s boot drive.
First locate your SATA Controller
lspci | grep SATA
Example output:
07:00.2 SATA controller: Advanced Micro Devices, Inc. [AMD] FCH SATA Controller [AHCI mode] (rev 51)
Add your the SATA Controller to
/etc/modprobe.d/vfio.conf
echo "options vfio-pci ids=07:00.2" | sudo tee -a /etc/modprobe.d/vfio.conf
NOTE:
These steps will also work for an LSI HBA installed in a pcie slot
sudo reboot now
sudo dmesg | grep -e DMAR -e IOMMU
If you are running your host headless you can access the graphical environment using reminna over xrdp if you install
xrd
and disabled wayland
Login to the desktop environment
- Navigate to
Settings>Power
- Set
Screen Blank
to Never- Set
Automatic Suspend
to Off
If you want to have VMs on the regular LAN and want to allow Host/VM communication you will need to create a bridge interface for your VMs. One of the simplets way to do this is using by using cockpit
Open cockpit in web browser (https://${server_ip}:9090)
- First enable administrative access (I advise logging out and back in after enabling it for your user)
- Navigate to Networking>[Add Bridge]
Bridge Settings
Name
br0
Ports
- eno1 <–use whichever port you want to use to connect VM’s to the internet
Repeat for as many seperate ports as you want to give to your VM(s)
In the case of this example, the host will have a single TrueNAS-SCALE VM which will host all other VMs using nested virtualization. In this case it is a good idea to give the VM at least two network ports – one for management and another for everything else
- Navigate to Networking>[Add Bridge]
Bridge Settings
Name
br1
Ports
- eno2 <–use whichever port you want to use to connect VM’s to the internet
The instructions below are to replace the default virtual network with a bridged network. If you wish to create a seperate bridged network and leave the default network as is skip steps 3-4 below, and use another name for the network in place of
default
.
nano bridged-network.xml
```xml
3. #### Stop the default network
```bash
virsh net-destroy default
virsh net-undefine default
sudo virsh net-define bridged-network.xml
sudo virsh net-start default
sudo virsh net-autostart default
NOTE:
This can also be done in virt manager gui by going to Edit>Preferences and ticking “Enable XML Editing”.
curl https://download.truenas.com/TrueNAS-SCALE-Angelfish/22.02.4/TrueNAS-SCALE-22.02.4.iso -o TrueNAS-SCALE-22.02.4.iso
sudo cp TrueNAS-SCALE-22.02.4.iso /var/lib/libvirt/images
20G
disk is more than enoughhost-passthrough
Complete install via graphical spice or vnc
cli -c "network interface create name=br0 type=BRIDGE bridge_members=eno1"
cli -c "network interface commit"
cli -c "network interface checkin"
**due to the horrendous state of networking in scale, these changes must be done over direct console via spice or vnc and all network connectivity (to truenas scale) will be lost until reboot!* https://ixsystems.atlassian.net/browse/NAS-118915