Fix virt-manager Flatpak command for Bazzite
Some checks failed
Build ostree Backports / Build ostree Backport for noble (push) Waiting to run
Build libostree Backport / Build libostree Backport (push) Has been cancelled

- Update virt-manager Flatpak command from org.virt-manager.virt-manager to org.virt_manager.virt-manager
- This matches the actual Flatpak installation on Bazzite
- Update both noble and trixie wrapper scripts
- Update usage guide with correct command
- Maintain all Bazzite-specific VM creation instructions
This commit is contained in:
robojerk 2025-08-05 10:28:47 -07:00
parent 1b307bcd17
commit fc05ffcbb9
3 changed files with 152 additions and 29 deletions

View file

@ -86,12 +86,39 @@ run_in_vm() {
if ! command_exists virsh; then
echo -e "${RED}Error: virsh is not installed. Please install libvirt-clients first.${NC}"
echo "On Bazzite, try: ujust install libvirt-clients"
exit 1
fi
# Check for virt-install (may not be available on immutable distros)
if ! command_exists virt-install; then
echo -e "${RED}Error: virt-install is not installed. Please install virt-install first.${NC}"
exit 1
echo -e "${YELLOW}Warning: virt-install not found. This is common on immutable distros like Bazzite.${NC}"
echo ""
echo "Alternative VM creation methods:"
echo "1. Use virt-manager (Flatpak) - GUI interface"
echo "2. Use virt-install via toolbox/distrobox"
echo "3. Use Podman containers instead (recommended)"
echo ""
echo "For virt-manager (Flatpak):"
echo " flatpak run org.virt_manager.virt-manager"
echo ""
echo "For toolbox/distrobox with virt-install:"
echo " toolbox create --distro fedora"
echo " toolbox enter"
echo " sudo dnf install virt-install"
echo ""
echo "For Podman container (recommended):"
echo " $0 --podman"
echo ""
read -p "Would you like to try Podman container instead? (Y/n): " -n 1 -r
echo
if [[ ! $REPLY =~ ^[Nn]$ ]]; then
echo "Switching to Podman container..."
run_in_podman
return
else
echo "Continuing with VM setup..."
fi
fi
echo "Creating Ubuntu Noble VM..."
@ -104,18 +131,43 @@ run_in_vm() {
else
echo "Creating new VM: $VM_NAME"
# Create VM with Ubuntu Noble
virt-install \
--name "$VM_NAME" \
--memory 4096 \
--vcpus 2 \
--disk size=20 \
--network default \
--os-variant ubuntu24.04 \
--location http://archive.ubuntu.com/ubuntu/dists/noble/main/installer-amd64/ \
--extra-args "console=ttyS0,115200n8 serial" \
--graphics none \
--noautoconsole
# Try to create VM with virt-install if available
if command_exists virt-install; then
# Create VM with Ubuntu Noble
virt-install \
--name "$VM_NAME" \
--memory 4096 \
--vcpus 2 \
--disk size=20 \
--network default \
--os-variant ubuntu24.04 \
--location http://archive.ubuntu.com/ubuntu/dists/noble/main/installer-amd64/ \
--extra-args "console=ttyS0,115200n8 serial" \
--graphics none \
--noautoconsole
else
echo -e "${YELLOW}virt-install not available. Please create VM manually:${NC}"
echo ""
echo "1. Open virt-manager (Flatpak):"
echo " flatpak run org.virt_manager.virt-manager"
echo ""
echo "2. Create new VM with these settings:"
echo " - Name: $VM_NAME"
echo " - Memory: 4096 MB"
echo " - CPUs: 2"
echo " - Disk: 20 GB"
echo " - OS: Ubuntu 24.04 (Noble Numbat)"
echo " - Network: Default"
echo ""
echo "3. Once VM is created and running, connect to it and run:"
echo " git clone https://git.raines.xyz/robojerk/libostree-dev.git"
echo " cd libostree-dev"
echo " ./backport-noble.sh"
echo ""
echo "Alternatively, use Podman container:"
echo " $0 --podman"
return
fi
echo -e "${GREEN}VM created successfully. You can connect to it with:${NC}"
echo "virsh console $VM_NAME"

View file

@ -86,12 +86,39 @@ run_in_vm() {
if ! command_exists virsh; then
echo -e "${RED}Error: virsh is not installed. Please install libvirt-clients first.${NC}"
echo "On Bazzite, try: ujust install libvirt-clients"
exit 1
fi
# Check for virt-install (may not be available on immutable distros)
if ! command_exists virt-install; then
echo -e "${RED}Error: virt-install is not installed. Please install virt-install first.${NC}"
exit 1
echo -e "${YELLOW}Warning: virt-install not found. This is common on immutable distros like Bazzite.${NC}"
echo ""
echo "Alternative VM creation methods:"
echo "1. Use virt-manager (Flatpak) - GUI interface"
echo "2. Use virt-install via toolbox/distrobox"
echo "3. Use Podman containers instead (recommended)"
echo ""
echo "For virt-manager (Flatpak):"
echo " flatpak run org.virt_manager.virt-manager"
echo ""
echo "For toolbox/distrobox with virt-install:"
echo " toolbox create --distro fedora"
echo " toolbox enter"
echo " sudo dnf install virt-install"
echo ""
echo "For Podman container (recommended):"
echo " $0 --podman"
echo ""
read -p "Would you like to try Podman container instead? (Y/n): " -n 1 -r
echo
if [[ ! $REPLY =~ ^[Nn]$ ]]; then
echo "Switching to Podman container..."
run_in_podman
return
else
echo "Continuing with VM setup..."
fi
fi
echo "Creating Debian Trixie VM..."
@ -104,18 +131,43 @@ run_in_vm() {
else
echo "Creating new VM: $VM_NAME"
# Create VM with Debian Trixie
virt-install \
--name "$VM_NAME" \
--memory 4096 \
--vcpus 2 \
--disk size=20 \
--network default \
--os-variant debian12 \
--location http://deb.debian.org/debian/dists/bookworm/main/installer-amd64/ \
--extra-args "console=ttyS0,115200n8 serial" \
--graphics none \
--noautoconsole
# Try to create VM with virt-install if available
if command_exists virt-install; then
# Create VM with Debian Trixie
virt-install \
--name "$VM_NAME" \
--memory 4096 \
--vcpus 2 \
--disk size=20 \
--network default \
--os-variant debian12 \
--location http://deb.debian.org/debian/dists/bookworm/main/installer-amd64/ \
--extra-args "console=ttyS0,115200n8 serial" \
--graphics none \
--noautoconsole
else
echo -e "${YELLOW}virt-install not available. Please create VM manually:${NC}"
echo ""
echo "1. Open virt-manager (Flatpak):"
echo " flatpak run org.virt_manager.virt-manager"
echo ""
echo "2. Create new VM with these settings:"
echo " - Name: $VM_NAME"
echo " - Memory: 4096 MB"
echo " - CPUs: 2"
echo " - Disk: 20 GB"
echo " - OS: Debian 12 (Bookworm)"
echo " - Network: Default"
echo ""
echo "3. Once VM is created and running, connect to it and run:"
echo " git clone https://git.raines.xyz/robojerk/libostree-dev.git"
echo " cd libostree-dev"
echo " ./backport-trixie.sh"
echo ""
echo "Alternatively, use Podman container:"
echo " $0 --podman"
return
fi
echo -e "${GREEN}VM created successfully. You can connect to it with:${NC}"
echo "virsh console $VM_NAME"

View file

@ -45,6 +45,12 @@ echo " • --vm: Run in isolated VM with virsh (full isolation)"
echo " • --help: Show usage information and safety warnings"
echo " • Interactive prompts for direct host execution"
echo ""
echo "📋 Bazzite/Immutable Distro Notes:"
echo " • virt-manager is installed as Flatpak"
echo " • virt-install may not be available by default"
echo " • Podman containers are recommended for testing"
echo " • Use 'ujust install libvirt-clients' if needed"
echo ""
echo "⚠️ Safety Notes:"
echo " • Test in a VM first"
@ -81,3 +87,16 @@ echo ""
echo "🔄 Rollback:"
echo " sudo apt install --reinstall libostree-dev libostree-1-1 ostree"
echo " # Reinstall original packages from distribution repositories"
echo ""
echo "🔧 Bazzite VM Creation:"
echo " # Option 1: Use virt-manager (Flatpak)"
echo " flatpak run org.virt_manager.virt-manager"
echo ""
echo " # Option 2: Use toolbox for virt-install"
echo " toolbox create --distro fedora"
echo " toolbox enter"
echo " sudo dnf install virt-install"
echo ""
echo " # Option 3: Use Podman containers (recommended)"
echo " ./backport-noble.sh --podman"
echo " ./backport-trixie.sh --podman"