Setup Fedora VM Using Virtual Machine Manager

I’m using Ubuntu for my everyday work. Recently, I have some tasks relating SELinux. Unfortunately, SELinux is by default not enabled in Ubuntu, and the ecosystem is not as full as it in Fedora.

In this article, I wrote down the steps to setup an Fedora VM via Virtual Maching Manager, and using ssh to login Fedora.

Install Virtual Machine Manager

sudo apt-get install virt-manager

Download the Fedora Workstation ISO

I’m using Fedora 38. Download from the official site or simple using the command below.

wget https://download.fedoraproject.org/pub/fedora/linux/releases/38/Workstation/x86_64/iso/Fedora-Workstation-Live-x86_64-38-1.6.iso

Create Fedora VM and Install

Click “Create a new virtual machin”.

Click “Forward”.

Follow the steps below to select the Fedora ISO we just downloaded.

Set proper memory and CPU and disk size.

Set the name of the VM, click “Finish”.

Now the boot process starts. We firstly boot from the ISO and then install to the disk.

Install Fedora. The installation destination is not set. Click “Installation Destination” to set.

Double click the only disk in “Local Standard Disks”, which is created for us in the VM creation steps, then click “Done”. Then click “Begin Installation”.

After installation is done and reboot, we can boot from the disk.

After reboot and login, open “Terminal” app. Then go to the next section.

Setup ssh login

Since openssh-server is already installed by default, we could simply enable it.

# Guest terminal
systemctl enable sshd
systemctl start sshd

Copy public key from host.

# Host terminal
cat ~/.ssh/id_rsa.pub

Paste the output to the guest machine.

# Guest terminal
mkdir -p ~/.ssh

# Paste the output to ~/.ssh/authorized_keys

Obtain guest’s IP address

# Guest terminal
ifconfig | grep 192
> 192.168.123.25

Login guest from host.

ssh <username>@192.168.123.25
CC BY-NC-SA 4.0
Built with Hugo
Theme Stack designed by Jimmy