Configuring Fedora 25 as a Hypervisor using Virtual Machine Manager


After following the below instructions, you should be able to deploy VMs that:

  1. Can be accessed by IP from the Host
  2. Can communicate with each other
  3. Can communicate to the external network
  4. Are not accessible beyond your Host

While these instructions were performed on a Fedora 25 machine, they should work on other supported versions and few other distros with minimal command modifications.

Package Installation and Services

  1. Make sure your system is up to date and restart if necessary:
    • sudo dnf update -y ; reboot
  2. Install the required packages:
    • sudo dnf install virt-manager qemu-kvm qemu-img libvirt-daemon libvirt-daemon-driver*
  3. Start the Libvirt Daemon:
    • sudo systemctl start libvirtd

Configure the Virtual Network

This network will be accessible within your Host environment only and will be service IP Addresses by DHCP to your VMs.

  1. Open virt-manager by searching for it in the Gnome search bar, by finding it under the KDE applications menu, or by launching it through terminal using sudo virt-manager.
  2. Go to Edit – Connection Details.
  3. Click on the Virtual Networks tab and then click the plus (+) sign at the lower left corner of the window.
    1. For Network Name, choose something simple, such as “virtnet” and click Forward.
    2. Verify that Enable IPv4… and Enable DHCPv4 are both checked.
      • Network: (example)
      • Start: (example)
      • End: (example)
    3. Click Forward twice to skip IPv6 DHCP configuration unless you plan on needing it for another reason than deploying more than 4.3 billion VMs.
    4. Select Forward to physical network and leave other settings default.
    5. Click Finish.

You should now be able to deploy new VMs without much difficulty.

Deploying a Fedora 25 Server Guest VM (Exercise #1)

With Fedora, it is easy to deploy a VM using HTTP.  This will ensure you are always deploying with the latest packages available.

  1. Within Virtual Machine Manager, go to File – New Virtual Machine, or click on the Create a new virtual machine icon _below_ File.
  2. Select Network Install and then click Forward.
  3. For URL, paste in the following link and then click Forward four times:

Manually assigning an IP Address from the Host (Exercise #2)

Libvirt uses dnsmasq to manage the DHCP range of newly deployed VMs.  Due to this, you are given some flexibility to have dnsmasq manually assign IP Addresses based off of the VM’s MAC Address.

For this example, I am using the VM I deployed from the first exercise.

  1. From terminal on the Host, grab the MAC address of the fedora25 VM that was deployed:
    • sudo virsh dumpxml fedora25 | grep 'mac address'
  2. Next, use the MAC address shown to give that VM a specific IP Address ( in this example):
    • sudo virsh net-update virtnet add ip-dhcp-host "<host mac='######' name='fedora25' ip='192.168.100.#'/>" --live --config
  3. Finally, bounce the network adapter on the VM itself to grab the new IP.  Example:
    • sudo ifdown eth0 ; sudo ifup eth0


====== Fedora 25 Host

striker host ~ $ sudo virsh dumpxml fedora25 | grep ‘mac address’
<mac address=’52:54:00:a9:37:f0’/>

striker host ~ $ sudo virsh net-update virtnet add ip-dhcp-host “”<host mac=’52:54:00:a9:37:f0′ name=’fedora25′ ip=’’/>” –live –config
Updated network virtnet persistent config and live state

====== Fedora 25 VM

[root@fedora25 ~]# ip a | grep ‘inet 192’
inet brd scope global dynamic ens3

[root@fedora25 ~]# ifdown ens3
Device ‘ens3’ successfully disconnected.

[root@fedora25 ~]# ifup ens3
Connection successfully activated (D-Bus active path: /org/freedesktop/NetworkManager/ActiveConnection/1)

[root@fedora25 ~]# ip a | grep ‘inet 192’
inet brd scope global dynamic ens3

Adding a new Storage layer to a VM (Exercise #3)

This exercise will walk you through creating a virtual storage drive and attach it to your VM.  For the purpose of the exercise, I will be using the Fedora 25 Server VM deployed above.

  1. Within Virtual Machine Manager, highlight the VM you wish to add a new storage drive to and then click Open.
  2. Within the VM window, click the Lightbulb icon labeled Show virtual hardware details.
  3. In the bottom-left corner, click Add Hardware.
  4. Storage should be selected within the next window.  Choose the size you wish the new storage device to be and click Finish.
  5. Within the VM window, click on the Computer Monitor icon labeled Show the graphical console.
  6. You may need to restart the VM for the new storage device to show up.  Since we are using the Fedora 25 VM deployed above, the device shows up immediately:

[root@fedora25 ~]# lsblk
vdb 252:16 0 20G 0 disk   #   <———————–
vda 252:0 0 20G 0 disk
├─vda2 252:2 0 19G 0 part
│ ├─fedora-swap 253:1 0 2G 0 lvm [SWAP]
│ └─fedora-root 253:0 0 15G 0 lvm /
└─vda1 252:1 0 1G 0 part /boot

Stay in touch!

You can stay in touch with libvirt specialists by joining the OFTC IRC network and then joining the #virt channel.  Fedora’s IRC channel is #fedora on Freenode‘s IRC network.  You can also join the libvirt mailing list discussion by following the below link:

Deploy Windows 2016 AD and Fedora 25 IPA with a One-way Trust


For the purpose of this post, the two machines I used for these instructions are VMs running atop a Fedora 25 hypervisor which was configured as outlined here:

Configuring Fedora 25 as a Hypervisor using Virtual Machine Manager

Note: Make sure that when deploying IPA and AD that you do so on separate domains.  Otherwise, IPA clients will be querying the AD server directly when they dig the domain for ldap records.

INCORRECT: IPA Server: | AD Server:
CORRECT: IPA Server: | AD Server:
CORRECT: IPA Server: | AD Server:
CORRECT: IPA Server: | AD Server:
CORRECT: IPA Server: | AD Server:

Deploying Windows 2016 AD

  1. On my first VM, I booted using a Trial ISO of Windows Server 2016:
  2. Begin the installation with Windows Server 2016 Standard Evaluation (Desktop Experience).
  3. After the machine boots from installation, configure the Hostname:
    1. Server Manager – Local Server.
    2. Click on the machine’s current hostname.
    3. Click Change and change the hostname to your preference.
      • Example: win16ad01
  4. Configure Active Directory and DNS:
    1. Server Manager – Dashboard.
    2. Add Roles and Features.
    3. For Installation Type, choose Role-based or feature-based installation.
    4. For Server Roles, click Active Directory Domain Services and DNS Server.
    5. Within Server Manager, go to AD DS and click on More.
    6. Click on Promote this server to a domain….
    7. In the next window, choose Add a new Forest.
      • Here, set the full DN of your Forest.
        • Example:

Deploying Fedora 25 IPA

  1. For the second VM, I booted using the HTTP link to Fedora 25 Server:
  2. During pre-installation:
    1. Choose Minimal at Software Selection.
    2. In Network & Host Name, set the full hostname of the machine.
      • Example:
    3. Make sure to give /var a large amount of space, as this is where the IPA Database and Logs will be stored.
  3. After installation and reaching a root prompt:
    1. Install the IPA packages and the RNG package:
      • dnf install freeipa-server freeipa-server-dns freeipa-server-trust-ad rng-tools -y
      • The RNG daemon will generate free entropy to be used during the certificate database creation, otherwise that process can take a very long time to complete.
    2. Open the correct ports that IPA will use:
      • firewall-cmd --add-service=freeipa-ldap --add-service=freeipa-ldaps --add-service=freeipa-trust --permanent
      • firewall-cmd --reload
    3. Start the RNG Daemon:
      • systemctl start rngd
    4. Configure the IPA instance:
      • ipa-server-install --setup-dns
        1. For Server host name, press Enter (Hostname was set during pre-install).
        2. For Domain name and Realm name, press Enter.
        3. Press Enter when prompted for DNS forwarders.
        4. For Enter an IP address for a DNS forwarder, enter the IP Address of your Windows 2016 AD.
        5. Type yes and press Enter to finalize the pre-configuration and begin installation.

Configure the One-way Trust

  1. From the Fedora root prompt, prepare IPA for the trust:
    • ipa-adtrust-install
    • All options should be default.
  2. Configure and Verify the trust:
    1. ipa trust-add --type=ad --admin Administrator --password
      • Example: ipa trust-add --type=ad --admin Administrator --password
    2. id

Get involved and ask questions

You can get in touch with the IPA community by joining the #freeipa and #sssd channels on Freenode and the freeipa-users and sssd-users mailing lists.

Password Corral on Linux

Password Corral ( is one of the most simple, secure and easy to use password safes I have used.  When creating your password file which houses all of your passwords, you can choose between Blowfish or Diamond2 for an encryption method.  Both of which are pretty powerful.  You can read more about them here:

Password Corral is an EXE.  This means that it was meant to be run on Windows-based OSes.  However, it is quite easy to also run this on a Linux machine with the help of Wine.

On my Fedora box, I simply do:

sudo dnf install wine
cd ~/Downloads

Afterwards, just run:

wine ~/Downloads/password4.exe

Password Corral will store your data within ‘~/Documents/Password Corral Data’ which is easy to backup and restore if needed.

A simple Password-generating Bash Script

Most password safes have a generator for the password field when you are making a new entry.  Password Corral is a good example of this.  However, if you’re like me and like doing most things in a terminal, I wrote a fairly simple bash script which you can place into a $PATH of your choice and execute from anywhere.  Here’s the interesting bits:

#! /bin/bash

# This simple script will generate a password with the following:
# Uppercase Letter, Lowercase Letter, Number, Special Character
# Length of password is determined by a provided variable.
# The default password length is 8 characters.


echo ; echo “Generate random passwords.” ; echo
echo “How many? Default = 4” ; read rpassA
echo “How long? Default = 8” ; read rpassL

if [[ -z $rpassA ]]

if [[ -z $rpassL ]]

echo ; cat /dev/urandom | tr -dc “$rpassS$rpassLN” | fold -w ${rpassL} | head -n ${rpassA}

The best places to put this would be into ~/.local/bin or ~/bin (again, depending on your $PATH).  You can also remove or add to the symbols in ‘rpassS’ depending on your needs.  Just make sure that the dash (-) is not listed as the first symbol……

Generate your own Fandango Ticket QR Codes

Purchasing tickets online is great.  Being able to choose your seat while doing it is even better.  Why someone would request your Phone number in order to “text you your ticket” is beyond me.  Most of us have access to e-mail on our phones these days.

With Fandago, the process is pretty convoluted.  On your computer, you purchase your ticket.  You then have the option for them to “text it to you”.  The only thing they do is text you an HTTP link which contains the ticket.  Why not just give me this link from the get-go instead of wanting my phone number for spam purposes?

Well, stop giving Fandango your phone number.  I have found a better way.  It seems that the QR Code they send you is merely your confirmation purchase number.

CONFIRMATION #11457111*******

You can try it yourself.  The next time you get a QR Code (or use one of the old ones), scan it and see what shows.  So, what does this mean?  Well, this means you can simply copy the confirmation number (11457111*******) from your e-mail on your phone into a QR Code generator and just use that at the ticket booth to get your ticket.

Stop giving Fandango your phone numbers for no reason other than for them to store it for “marketing purposes”.