wiki/getstarted/virt-install.md

101 lines
3.8 KiB
Markdown
Raw Normal View History

2021-11-12 15:27:42 +00:00
---
title: Linux family
description:
published: true
2023-05-13 16:09:41 +00:00
date: 2023-05-13T16:09:39.731Z
2021-11-12 15:27:42 +00:00
tags:
editor: markdown
dateCreated: 2021-11-12T15:27:40.366Z
---
2023-05-13 16:09:41 +00:00
# Unattended deployment of an RPM-based guest
2021-11-12 15:45:05 +00:00
2022-01-11 14:49:26 +00:00
* `virt-install` is a command-line utility that can be used to create virtual machines. It comes preinstalled with Phyllome OS.
2021-11-12 15:45:05 +00:00
2022-01-11 14:50:09 +00:00
## Deployment using a hosted kickstart file
2021-11-12 15:45:05 +00:00
2022-01-17 15:21:02 +00:00
* The following command will create a virtual machine with a 10G virtual disk and deploy an RPM-based operating system with a stripped-down GNOME desktop environment inside. Most settings can be modified after the installation.
2021-11-12 15:45:05 +00:00
2022-01-11 14:49:26 +00:00
> Please verify the content of [the kickstart script](https://raw.githubusercontent.com/PhyllomeOS/phyllomeos/main/dishes/virtual-desktop.cfg) used to automate the installation. You may replace the kickstart script by a kickstart script of your choice.
2021-11-26 21:06:37 +00:00
{.is-info}
2022-01-18 08:30:39 +00:00
* Copy the command below, open you favorite terminal, paste the content, and press <kbd>enter</kbd>.
2021-11-12 15:45:05 +00:00
```
2021-11-26 21:06:37 +00:00
virt-install \
2022-01-11 14:49:26 +00:00
--connect qemu:///system \
2021-11-26 21:06:37 +00:00
--os-variant detect=off \
2021-11-12 15:45:05 +00:00
--virt-type kvm \
--arch x86_64 \
--machine q35 \
2022-01-11 14:49:26 +00:00
--name virtual-desktop \
2021-11-12 15:45:05 +00:00
--boot uefi \
2021-11-26 21:06:37 +00:00
--cpu host-model,topology.sockets=1,topology.cores=2,topology.threads=1 \
--vcpus 2 \
--memory 4096 \
2021-11-12 15:45:05 +00:00
--video virtio \
2021-11-26 21:06:37 +00:00
--graphics spice,listen=none \
2021-11-12 15:45:05 +00:00
--channel spicevmc \
2021-11-26 21:06:37 +00:00
--channel unix,target.type=virtio,target.name=org.qemu.guest_agent.0 \
2021-11-12 15:45:05 +00:00
--autoconsole none \
2021-11-26 21:06:37 +00:00
--console pty,target.type=virtio \
2021-11-12 15:45:05 +00:00
--sound none \
2022-01-11 15:21:59 +00:00
--network type=default,model=virtio \
2021-11-12 15:45:05 +00:00
--controller type=virtio-serial \
--controller type=usb,model=none \
--controller type=scsi,model=virtio-scsi \
--input type=keyboard,bus=virtio \
--input type=tablet,bus=virtio \
--rng /dev/urandom,model=virtio \
2022-01-11 14:49:26 +00:00
--disk path=/var/lib/libvirt/images/virtual-desktop.img,format=raw,bus=virtio,cache=writeback,size=10 \
2023-05-13 16:08:56 +00:00
--location=https://download.fedoraproject.org/pub/fedora/linux/releases/38/Everything/x86_64/os/ \
2022-01-11 15:25:34 +00:00
--extra-args="inst.ks=https://raw.githubusercontent.com/PhyllomeOS/phyllomeos/main/dishes/virtual-desktop.cfg"
2021-11-12 15:45:05 +00:00
```
2022-01-11 14:49:26 +00:00
2022-01-11 14:50:09 +00:00
## Deployment using a local kickstart file
2021-11-12 15:45:05 +00:00
2022-01-11 14:49:26 +00:00
* Use the following `wget` command to fetch a standalone kickstart file made to deploy a stripped-down desktop system with GNOME Shell, and put it in the working directory
2021-11-12 15:45:05 +00:00
```
2022-01-11 14:49:26 +00:00
wget https://raw.githubusercontent.com/PhyllomeOS/phyllomeos/main/dishes/virtual-desktop.cfg
2021-11-12 15:45:05 +00:00
```
2021-11-26 21:12:11 +00:00
> Please verify the content of the script if you intent to use this virtual machine in production, for instance by using the following command `cat virtual-desktop.cfg`
{.is-info}
* Deploy a stripped-down desktop based on GNOME Shell using the local kickstart file previously downloaded
2021-11-26 21:12:11 +00:00
2021-11-12 15:45:05 +00:00
```
2021-11-26 21:12:11 +00:00
virt-install \
2022-01-11 14:49:26 +00:00
--connect qemu:///system \
2021-11-26 21:12:11 +00:00
--os-variant detect=off \
2021-11-12 15:45:05 +00:00
--virt-type kvm \
--arch x86_64 \
--machine q35 \
2021-11-30 17:57:20 +00:00
--name virtual-desktop \
2021-11-12 15:45:05 +00:00
--boot uefi \
2021-11-26 21:12:11 +00:00
--cpu host-model,topology.sockets=1,topology.cores=2,topology.threads=1 \
--vcpus 2 \
--memory 4096 \
2021-11-12 15:45:05 +00:00
--video virtio \
2021-11-26 21:12:11 +00:00
--graphics spice,listen=none \
2021-11-12 15:45:05 +00:00
--channel spicevmc \
2021-11-26 21:12:11 +00:00
--channel unix,target.type=virtio,target.name=org.qemu.guest_agent.0 \
2021-11-12 15:45:05 +00:00
--autoconsole none \
2021-11-26 21:12:11 +00:00
--console pty,target.type=virtio \
2021-11-12 15:45:05 +00:00
--sound none \
2022-01-11 15:21:59 +00:00
--network type=default,model=virtio \
2021-11-12 15:45:05 +00:00
--controller type=virtio-serial \
--controller type=usb,model=none \
--controller type=scsi,model=virtio-scsi \
--input type=keyboard,bus=virtio \
--input type=tablet,bus=virtio \
--rng /dev/urandom,model=virtio \
2022-01-11 14:49:26 +00:00
--disk path=/var/lib/libvirt/images/virtual-desktop.img,format=raw,bus=virtio,cache=writeback,size=10 \
--location=https://download.fedoraproject.org/pub/fedora/linux/releases/38/Everything/x86_64/os/ \
2021-11-30 17:57:20 +00:00
--initrd-inject virtual-desktop.cfg --extra-args "inst.ks=file:/virtual-desktop.cfg"
2021-11-12 15:45:05 +00:00
```
2021-11-27 09:59:14 +00:00
---
2022-01-17 15:21:02 +00:00
*[**Go to parent page**](https://wiki.phyllo.me/)*