C.2. Creating a Red Hat Enterprise Linux 7 Image
Use this section to create an image in the QCOW2 format using a Red Hat Enterprise Linux 7 ISO file.
-
Using your web browser, download the Red Hat Enterprise Linux binary ISO file to a temporary location, for example, the
Downloadsdirectory. Copy the Red Hat Enterprise Linux binary ISO file to the
/var/lib/libvirt/images/directory.cp ~/home/user/Downloads/rhel-server-7.4-x86_64-dvd.iso /var/lib/libvirt/images/
[root@host]# cp ~/home/user/Downloads/rhel-server-7.4-x86_64-dvd.iso /var/lib/libvirt/images/Copy to Clipboard Copied! Toggle word wrap Toggle overflow Verify that virtbr0 is the virtual bridge:
ip a
[root@host]# ip aCopy to Clipboard Copied! Toggle word wrap Toggle overflow Start
libvirtd:systemctl start libvirtd
[root@host]# systemctl start libvirtdCopy to Clipboard Copied! Toggle word wrap Toggle overflow Navigate to the
/var/lib/libvirt/images/directory:cd /var/lib/libvirt/images/
[root@host]# cd /var/lib/libvirt/images/Copy to Clipboard Copied! Toggle word wrap Toggle overflow Prepare the QEMU image:
qemu-img create -f qcow2 rhel7.qcow2 8G
[root@host]# qemu-img create -f qcow2 rhel7.qcow2 8GCopy to Clipboard Copied! Toggle word wrap Toggle overflow Start the installation using
virt-install. Use the following example as a guide:virt-install --virt-type qemu --name rhel7 --ram 2048 \ --cdrom rhel-server-7.4-x86_64-dvd.iso \ --disk rhel7.qcow2,format=qcow2 \ --network=bridge:virbr0 --graphics vnc,listen=0.0.0.0 \ --noautoconsole --os-type=linux --os-variant=rhel7
[root@host]# virt-install --virt-type qemu --name rhel7 --ram 2048 \ --cdrom rhel-server-7.4-x86_64-dvd.iso \ --disk rhel7.qcow2,format=qcow2 \ --network=bridge:virbr0 --graphics vnc,listen=0.0.0.0 \ --noautoconsole --os-type=linux --os-variant=rhel7Copy to Clipboard Copied! Toggle word wrap Toggle overflow 注記For GUI users, if the instance does not launch automatically, enter the
virt-managercommand to view the console:virt-manager
[root@host]# virt-managerCopy to Clipboard Copied! Toggle word wrap Toggle overflow Follow the steps of the Red Hat Enterprise Linux installation wizard.
-
For the installation source, add an HTTP link to your repository in Red Hat Satellite, for example
satellite.example.com/pub/export/RHEL7/content/dist/rhel/server/7/7Server/x86_64/os/ - For the type of devices your installation uses, select Auto-detected installation media.
- For the type of installation destination, select Local Standard Disks.
- For other storage options, select Automatically configure partitioning.
- For software selection, select Minimal Install.
- Set the network interface to ON to ensure the interface activates on system start.
- Enter a host name, and click Apply.
-
Enter a
rootpassword.
-
For the installation source, add an HTTP link to your repository in Red Hat Satellite, for example
- When the installation completes, reboot the instance and log in as the root user.
Confirm that the network interface is up and that the IP address is assigned:
ip a
# ip aCopy to Clipboard Copied! Toggle word wrap Toggle overflow Confirm that the hostname is correct:
hostname
# hostnameCopy to Clipboard Copied! Toggle word wrap Toggle overflow Create a
/etc/NetworkManager/conf.d/XX-cloud-image.conffile where XX is a two-digit number that indicates order of precedence. Add the following contents to the file:[main] dns=none
[main] dns=noneCopy to Clipboard Copied! Toggle word wrap Toggle overflow - Proceed to Configuring a Host for Registration.