C.3. Creating a Red Hat Enterprise Linux 6 Image
Use this section to create an image in the QCOW2 format using a Red Hat Enterprise Linux 6 ISO file.
Start the installation using
virt-install:[root@host]# qemu-img create -f qcow2 rhel6.qcow2 4G [root@host]# virt-install --connect=qemu:///system --network=bridge:virbr0 \ --name=rhel6 --os-type linux --os-variant rhel6 \ --disk path=rhel6.qcow2,format=qcow2,size=10,cache=none \ --ram 4096 --vcpus=2 --check-cpu --accelerate \ --hvm --cdrom=rhel-server-6.8-x86_64-dvd.isoThis launches an instance and starts the installation process.
注記If the instance does not launch automatically, enter the
virt-viewercommand to view the console:[root@host]# virt-viewer rhel6Set up the virtual machines as follows:
- At the initial Installer boot menu, select the Install or upgrade an existing system option.
- Select the appropriate Language and Keyboard options.
- When prompted about which type of devices your installation uses, select Basic Storage Devices.
-
Select a
hostnamefor your device. The default host name islocalhost.localdomain. - Set a root password.
- Based on the space on the disk, select the type of installation.
- Select the Basic Server install, which includes an SSH server.
-
Reboot the instance and log in as the
rootuser. Update the
/etc/sysconfig/network-scripts/ifcfg-eth0file so it only contains the following values:TYPE=Ethernet DEVICE=eth0 ONBOOT=yes BOOTPROTO=dhcp NM_CONTROLLED=noRestart the service network:
# service network restart- Proceed to Configuring a Host for Registration.