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.[root@host]# cp ~/home/user/Downloads/rhel-server-7.4-x86_64-dvd.iso /var/lib/libvirt/images/Verify that virtbr0 is the virtual bridge:
[root@host]# ip aStart
libvirtd:[root@host]# systemctl start libvirtdNavigate to the
/var/lib/libvirt/images/directory:[root@host]# cd /var/lib/libvirt/images/Prepare the QEMU image:
[root@host]# qemu-img create -f qcow2 rhel7.qcow2 8GStart the installation using
virt-install. Use the following example as a guide:[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=rhel7注記For GUI users, if the instance does not launch automatically, enter the
virt-managercommand to view the console:[root@host]# virt-managerFollow 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 aConfirm that the hostname is correct:
# hostnameCreate 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- Proceed to Configuring a Host for Registration.