Continuing the discussion from [Guide] Custom Install Disk Partitioning LVM Layout in Qubes 4.2 which addresss the partitionning in TUI
I think it’s good enough, but then when I go back to the GUI (first phase) it crashes, It ask me for crypt password, tells me it can’t open, then an error window post-up and I have to quit.
EDIT: it seems only one of the two crypt LVM is giving problems, I managed to open and mount the first one, but the large one with vm-pool and root-pool, in Thin LVM (and RAID1) doesn’t allow me to mount (give a mount point in the GUI, it’s greyed)
Any idea how to do the remaining of the install (actually installing the OS) in TUI ?
- I’ve tried ./install.py => failed.
- I’ve tried ./anaconda => failed
- I’ve tried chmod /mnt/qubes => failed to run command ‘bin/sh’: no such file
- I’ve tried adding ‘text’ in the installer boot menu:
- –
multiboot2 /images/pxeboot/xen.gz console=none **inst.text**
- –
module2 /images/pxeboot/vmlinuz inst.repo=hd:LABEL=QUBES-R4-2-4-X86-64 plymouth-ignore-serial-consoles quiet **inst.nodmraid**
=> Failed, t still boots in GUI.
? Some like: => dnf --installroot=/ --repo=qubes-os -y groupinstall ‘Qubes OS Core’ ?
Then at re-start, for the second phase, it will be in GUI as normal.
Thank you !
First tentative (Still WIP, to be criticized)
# Manual Installation (after manual partitioning) of Qubes OS 4.2.x
## Introduction:
// This guide is for manual installation strategy on a system with three NVMe drives (two in RAID), 128GB of RAM, and an NVIDIA A2000 GPU.
// The Qubes OS GUI installer (Anaconda) doesn't like my manual LVM configuration. This guide is executed from the **Text-based User Interface (TUI)**.
// Important: This guide only covers install of basic OS. The config of templates and domains will necessarily be done in GUI install 2nd phase after first reboot
## Objectives
- TUI finish the first phase of the insllation (Main system only)
- Allowing to learn internal mecanism of Qubes OS install
-
- vm-pool on a RAID1 partition (Separate from root-pool)
- Once main system is install, reboot will restart in GUI for second phase (installation of the VMs)
REM # STEPS.X: 1) Base and Shell -> 2) Config -> 3) Config -> 4) Config -> 5) Config -> 6) Config -> 7) Tweak and adapatation for my P15 gen2
## STEP.0: Preparation: Environnement: Shell Anaconda from DVD install
// Prerequisite: Partitioning done in TUI (previous guide) wih LUKS + LVM on RAID1
// Prerequisite: You shold be on prompt `[Anaconda root@localhost /]#`
# optional: Check keyboard layout (Crucial for later, i.e: your password):
=> localectl status
# If it's not the one you want, try:
=> loadkeys <code> # code like: es_ES; es_MX; es_AR; ca_ES; ca_FR; fr_BE; fr_CA; fr_CH; fr_LU
# Warning ! Even if present in /usr/share/locale/* The TUI might not be ble to load it, so mapping will be default 'en_US'
// View current partitions
=> lsblk # List all block devices
# optional: *IF* you have to re-open LUKS
cryptsetup open /dev/md10 LUKS_ROOT
cryptsetup open /dev/nvme0n1p3 LUKS_SRUN
# optional: 8IF8 you have to re-open VG
vgchange -ay qubes_dom0
vgchange -ay qubes_dom1
# For all 'mkdir' and 'mount' please refer to previous (partitioning) guide
## STEP.1: Config repository
## STEP.1A: Install repository should be in `/etc/anaconda.repos.d/`
# Verify available repository
=> ls /etc/anaconda.repos.d/
You should have:
- `fedora.repo`
- `fedora.updates.repo`
- `qubes-dom0.repo`
- `qubes-templates.repo`
# Copy the config of the target system
=> mkdir -p /mnt/etc/yum.repos.d
=> cp /etc/anaconda.repos.d/* /mnt/etc/yum.repos.d/
## STEP.1B: CReate local repo
# Since the TUI doesn't have Internet access, repo are local from DVD
=> cat > /mnt/etc/yum.repos.d/local-install.repo << 'EOF'
>[local-install]
>name=Local Installation Packages
>baseurl=file:///run/install/repo
>enabled=1
>gpgcheck=0
EOF
## STEP.1C: Install base system
# Installation du système de fichiers de base
=> dnf --installroot=/mnt --disablerepo="*" --enablerepo="local-install" install filesystem
# Answer 'Y' (Yes) when asked
// Note: Ignore error about scriptlets (normal without systemd active)
## STEP.1D: Install essentials components
// You might have to adapt the next step depending on these results.
# Search for available 'kernel' packages
=> dnf --installroot=/mnt --disablerepo="*" --enablerepo="local-install" search kernel | head -10
# Search for available 'Xen' packages
=> dnf --installroot=/mnt --disablerepo="*" --enablerepo="local-install" search xen | head -10
# Search for available 'Grub' packages
=> dnf --installroot=/mnt --disablerepo="*" --enablerepo="local-install" search grub | head -10
## STEP.1E: Install found packages
# Install kernel, Xen and GRUBs (all in one line)
=> dnf --installroot=/mnt --disablerepo="*" --enablerepo="local-install" install \
kernel xen-hypervisor grub2-efi-x64 grub2-tools grub2-tools-efi
// Note: You should have ~154 packages installed
## STEP.1F: Install essentials system tools (all in one line)
=> dnf --installroot=/mnt --disablerepo="*" --enablerepo="local-install" install \
bash coreutils util-linux systemd
## STEP.1G: Config base system
# Config du hostname
=> echo "qubes-dom0" > /mnt/etc/hostname
## STEP.2: Config `/etc/fstab` :
=> cat > /mnt/etc/fstab << 'EOF'
>/dev/qubes_dom0/root / ext4 defaults 1 1
>/dev/nvme0n1p2 /boot ext4 defaults 1 2
>/dev/nvme0n1p1 /boot/efi vfat umask=0077,shortname=winnt 0 2
>/dev/qubes_dom1/swap none swap defaults 0 0
>/dev/qubes_dom1/tmp /tmp ext2 defaults 1 2
>/dev/qubes_dom1/var-tmp /var/tmp ext2 defaults 1 2
>/dev/qubes_dom1/var-log /var/log ext2 defaults 1 2
>/dev/qubes_dom1/var-cache /var/cache ext4 defaults 1 2
>/dev/qubes_dom1/var-lib-xen /var/lib/xen ext4 defaults 1 2
>EOF
# Adapt paths according to your config
## STEP.3: Prep for environment 'chroot'
# Mount pseudo-systems files
=> mount --bind /dev /mnt/dev
=> mount --bind /proc /mnt/proc
=> mount --bind /sys /mnt/sys
=> mount --bind /run /mnt/run
## STEP.4: Config bootloader
# Enter in the installed system
=> chroot /mnt /usr/bin/bash
## STEP.4A: Config GRUB for Xen
=> echo 'GRUB_DEFAULT=0' >> /etc/default/grub
=> echo 'GRUB_TIMEOUT=5' >> /etc/default/grub
=> echo 'GRUB_DISTRIBUTOR="Qubes"' >> /etc/default/grub
=> echo 'GRUB_CMDLINE_LINUX_DEFAULT="console=vga"' >> /etc/default/grub
=> echo 'GRUB_CMDLINE_XEN_DEFAULT="console=vga dom0_mem=min:1024M dom0_max_vcpus=4"' >> /etc/default/grub
## STEP.4C: Install GRUB on EFI
=> grub2-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=Qubes
## STEP.4D: Generate config GRUB
=> grub2-mkconfig -o /boot/grub2/grub.cfg
## STEP.4E: Generate 'initramfs'
=> dracut --regenerate-all --force
# Exit 'chroot'
=> exit
## STEP.5: Config LUKS for (re)start
# If you have LUKS partitions, config autom unlock
=> chroot /mnt /usr/bin/bash
# Gather the UUIDs of the LUKS
=> ROOT_UUID=$(blkid -s UUID -o value /dev/md10)
=> SRUN_UUID=$(blkid -s UUID -o value /dev/nvme0n1p3)
# Config crypttab
=> cat > /etc/crypttab << EOF
>LUKS_ROOT UUID=${ROOT_UUID} none luks
>LUKS_SRUN UUID=${SRUN_UUID} none luks
>EOF
# Re-generate initramfs with support LUKS
=> dracut --regenerate-all --force --add crypt
=> exit
## STEP.6: Finalizing
# unmount pseudo-systems files
=> umount /mnt/dev /mnt/proc /mnt/sys /mnt/run
# Deactivate swap
=> swapoff /dev/qubes_dom1/swap
# Restart system
=> reboot
REM # First start
# Upon start:
1. **GRUB** will appear with Qubes boot options
2. You will have to enter your LUKS passphrase to unlock
3. The system will start and switch to GUI
4. The Config wizard will guide you to:
- Config templates (Fedora, Debian)
- Create user domains
- Config VM networks
REM # Troubleshooting
# Common errors:
- **"systemd-run: command not found"** in the scriptlets RPM → Normal, ignore
- **Part not mounted after restart** → Check `/etc/fstab` and `/etc/crypttab`
- **GRUB can't find Xen** → Check `xen-hypervisor` is installed
# Useful verifications
# Check mounted partitions
=> lsblk
=> df -h
# Check installed packages
=> chroot /mnt rpm -qa | grep -E "(kernel|xen|grub)"
# Check GRUB config
=> chroot /mnt cat /boot/grub2/grub.cfg | grep xen
## Conclusion
** Adventages of this method :**
- Total control over partitioning
- Understand internal mecanisms
- Possibility to automatize
- Deep learning of the system roots
** Limitations :**
- Much more complex than GUI
- Templates configs still in GUI
- Require advence system knowledge