Include this in VirtualBox tab of combined install guide as Steps 2 and Steps 3.
Bare Metal step 2 is included in this document, any changes made to the bare metal step 2, need to be made here as well!
Original guide for reference: get-started-rhel7-install-vbox.adoc
This step provides an overview of the key steps for installing Red Hat Enterprise Linux Server in a VirtualBox Virtual Machine (VM) so you can get started with software development. The VM you create will give you a Red Hat Enterprise Linux development environment that you can use on your system running Microsoft Windows, Mac OS X, Ubuntu, or other Linux.
-
Download and install VirtualBox.
-
Configure a VM to run Red Hat Enterprise Linux.
-
Boot the VM using the ISO file you downloaded in step 1 as a virtual DVD.
-
Install Red Hat Enterprise Linux.
Note: This tutorial does not replace the Red Hat Enterprise Linux Installation Guide or VirtualBox User Manual. Instead, this tutorial provides an overview of the key steps for software developers. For detailed instructions, see the respective manaul.
A few things to keep in mind:
-
You will be using the Server edition of Red Hat Enterprise Linux. This provides you with the widest range of software to develop and test with.
-
The VM will have a full graphical desktop. You will select Server with a GUI during installation.
-
After installation, you will configure additional software repositories that will provide you access to optional development software such as RHSCL and DTS.
The requirements for your physical system that will host the Red Hat Enterprise Linux VM are:
-
a 64-bit x86 machine with hardware virtualization assistance (Intel VT-X or AMD-V).
-
An operating system supported by VirtualBox such as Microsoft Windows 7 or later, Apple Mac OS X 10.8 or later, Ubuntu Linux 12.04 or later.
-
4 GB RAM (8 GB preferred).
-
24 GB of available disk space for the VM, the installation ISO file, and VirtualBox.
-
A processor with hardware virtualization assistance (Intel VT-x or AMD-V).
If you encounter difficulties at any point in this tutorial, see Troubleshooting and FAQ.
This guide uses VirtualBox is 5.0.x. You may also use VirtualBox 4.3.x though there will be some minor differences from what is described here. Older versions of VirtualBox may work but have not been tested.
Go to the VirtualBox Download page and download the installer for your system. After the download completes, click on the downloaded .exe
or .dmg
file to start the installation. During the installation you will need to agree to using administrative privileges for a number of the steps.
Ubuntu Linux and other Linux distributions includes packages for VirtualBox that you can install using your regular package management commands. On Ubuntu Linux use the following command:
$ sudo apt-get install virtualbox
If your distribution doesn’t include VirtualBox packages or the packages are older than VirtualBox 4.3.x, see the VirtualBox for Linux download page to download a package for your system.
A extension package is available for VirtualBox that provides support for USB devices, remote desktop access via RDP, and PXE boot. The software is provided in binary form as it is not open-source. The extension package is available on the VirtualBox Download page.
Intel and AMD processors have hardware extensions for accelerating virtualization. On some systems this support may be disabled by default in the system’s BIOS/UEFI. To enable the extensions, you might have to go into the system’s BIOS/UEFI setup configuration at boot time. Consult your system’s hardware documentation for more information.
On some Microsoft Windows systems it may be necessary to disable Microsoft Hyper-V virtualization in order to use VirtualBox. Only one virtualization platform, or hypervisor, can be active on a host system at a time. While hypervisors like VirtualBox only take control of the host system’s hardware virtualization capabilities when they are actually running a VM, Microsoft Hyper-V takes control at boot time. In order to use VirtualBox, Hyper-V must either be disabled or uninstalled. Consult Microsoft’s documentation for more information. Note: if you are interested in using Microsoft Hyper-V instead of VirtualBox, check the Red Hat Developers site for more information.
In this step you will create and configure the VM that will run Red Hat Enterprise Linux. The system you are running VirtualBox on is called the host system. Note: VirtualBox refers to the VM running Red Hat Enterprise Linux as the guest system. However, most of the options to control the VM are under the Machine menu entry.
First, launch VirtualBox from your system’s menu. On some systems, the menu entry will be called Oracle VM VirtualBox.
Before you create any VMs, you may wish to change where VirtualBox stores the files that are used as virtual hard disks for the VMs you create. By default, VirtualBox places these files in your home directory. You will need at least 16 GB of available space. To change the location, select Preferences from the File menu. Under General, change Default Machine Folder to your preferred location.
Click the New button to create a new VM. A series of dialog boxes will come up for you to configure the VM:
-
On the Create Virtual Machine dialog:
-
Set the VM memory size ro 4096 MB on the Memory size dialog. This value can be changed later. Then, cloick Next.
Next you will configure the new VM’s virtual hard disk. The size of the virtual hard disk, should be a minimum of 16 GB. While this setting can be changed later, it is a multi-step process not covered by this guide. Therefore it is recommended that you size the virtual hard disk to be large enough for your software development activities. Note: The space on your host system’s physical disk will not be allocated until it is used by the VM. Complete the next set of dialogs to configure the virtual hard disk:
-
Select Create a virtual hard disk now on the Hard disk dialog. Then, click Create to move to the next dialog.
-
Select VDI (VirtualBox Disk Image) on the Hard disk file type dialog. Then, click Next.
-
Select Dynamically allocated on the Storage on physical hard disk dialog. Then, click Next. image::images/rhel7-install/vbox/ubuntu-vbox-05-hd4.png[Screenshot HD Dynamic]
-
On the _File location and size+ dialog:
-
Change the name and location if desired.
-
Set the size to be a minimum of 16 GB.
-
Click Create. image::images/rhel7-install/vbox/ubuntu-vbox-05-hd2.png[Screenshot File Location]
-
At this point the basic VM configuration has been completed, however additional configuration is necessary. Click to select the new VM so that it is highlighted, then click the Settings button. Make the following changes: image::images/rhel7-install/vbox/ubuntu-vbox-06-settings1.png[Screenshot VM Created]
-
Select the General group, then click the Advanced tab. Enable copy-and-paste between the host system and the VM by setting Shared Clipboard and Drag’n’Drop to Bidirectional.
-
By default, the VM will have a single virtual processor. If your system has multiple processors or cores, you can add more. Select the System group, then click the Processor tab. Adjust Processors to the desired value.
-
In the Network group, under the Adapter 1 tab, you can configure the VM’s networking configuration. See VirtualBox Networking below for more information.
Next, configure the VM to use the Red Hat Enterprise Linux Server binary DVD ISO file as a virtual CD/DVD:
-
Select the Storage section of the VM Settings dialog.
-
Under Controller: IDE, select the CD icon that says Empty next to it.
-
On the right side, under Attributes, click the CD icon on the far right.
-
Select Choose Virtual Optical Disk File.
-
Navigate to the Red Hat Enterprise Linux Server binary DVD ISO file that you downloaded earlier.
-
Click OK to close the VM settings dialog.
You may create a folder that is shared between your host system and the Red Hat Enterprise Linux VM. This makes it easy to share files such as source code between the two systems. The configuration for shared folders can be performed now or anytime later.
Shared folders will only be available on the VM after the VirtualBox Guest Additions software is installed on the VM. Installation of VirtualBox Guest Additions is covered later with the other Red Hat Enterprise Linux post-installation steps.
To add a shared folder:
-
Select your RHEL VM in VirtualBox, the click the Settings button.
-
Select the Shared Folders group.
-
Click the folder icon with a + in the upper right corner.
-
In the Add Share dialog:
-
Enter the path on the host system in the Folder Path.
-
Ehter a name without spaces for the shared folder on the VM.
-
-
Click OK to close the VM Settings dialog.
To start the VM and begin installation, start VirtualBox if it isn’t already running, then select your VM and click the Start button. The VM should now boot up from the Red Hat Enterprise Linux Server DVD.
This section provides a brief overview of the steps for installing Red Hat Enterprise Linux. Detailed instructions can be found in the Red Hat Enterprise Linux Installation Guide.
There are a few key steps to remember during the installation process:
-
The Installation destination will be the virtual hard disk you created for the VM.
-
You should configure networking under Network and host name before starting the installation. You will need access to the Internet to complete registration and download additional software. The network can be configured after the system is installed. However, the steps are more straightforward during installation.
-
Select Server with a GUI under Software Selection so the system will boot into the full graphical environment after installation. By default, Red Hat Enterprise Linux Server will not install a graphical desktop.
-
Create your primary user account during installation: After the installation begins, you will be instructed to set a password for the root account and be given the opportunity to create a regular user account. You should create a user before the installation process completes. The regular user will be your primary login for development. The root account should only be used for system administration tasks. If you don’t create a user before the installation completes, you will need to reboot and then log in as root to create user accounts.
-
Start the system from the bootable disk and select Install Red Hat Enterprise Linux.
-
Select your preferred language and keyboard layout to use during installation.
-
Under Localization review the settings and make any necessary changes for date and time, language, and keyboard layout. Note: The Done button to return to the Installation summary screen is located in the upper left corner of the screen.
-
Perform the follow steps to make your software selection:
-
Click Software selection.
-
On the next screen, under Software selection, in the Base environment list on the left, select Server with GUI.
-
In the list Add-ons for selected environment on the right, select Development tools.
-
Click the Done button. Note: After returning to the Installation summary screen it will take several seconds to validate your choices.
-
-
Click Installation destination to specify which disk or partition(s) to install the software on. Note: It is important that you understand the choices that you are making in this section to avoid accidental data loss. It is strongly recommended that you read the Installation Destination section of the the Red Hat Enterprise Linux Installation Guide. The installation destination should be at least 16 GB or larger to accommodate the OS, graphical desktop, and development tools.
-
Click Network & host name to configure the network. If the system has more than one network adapter, select it from the list on the left. Then click the On/Off button on the right to enable the network adapter. Click Configure to review and/or change the default settings for the network adapter. Optionally, set a Host name for the system. Before leaving this screen, make sure there is at least one network adapter enabled with the switch in the On position. A network connection will be required to register the system and download system updates.
-
Click KDump to disable KDump and free up memory. Click the box next to Enable kdump so that it is no longer checked. Then click Done.
-
Click the Begin installation button when you are ready to start the actual installation.
-
On the next screen, while the installation is running, click User creation to create the user ID you will use to log in for normal work.
-
Click Root password to set the password for the root user. Note: If you choose a password that the system considers to be weak, you will need to click Done twice.
-
After the installation process completes, click the Reboot button.
If you need help, see Troubleshooting and FAQ.
This section has a number of post-installation steps that complete the installation of Red Hat Enterprise Linux and prepare it for software development. The steps are:
-
Accept the license agreements and register the system with the Red Hat Subscription Management..
-
Install the latest software updates and VirtualBox Guest Additions.
-
Add additional software repositories containing development software.
After installation, during the first boot of the system, you will be asked to accept the license agreement and register the system with Red Hat Subscription Management. Completing these steps are required for your system to download software from Red Hat.
-
Click License information to go the license acceptance screen.
-
Click the checkbox to accept the license.
-
Click Done in the upper left corner to return to the configuration screen.
-
-
If you didn’t configure a network during installation, click Network and host name to configure your network connection.
-
Click to On the Subscription Management Registration screen
-
Register your system with Red Hat. Use the same username and password that you created for the Red Hat Customer Portal. Note: For this step to succeed, you must have configured your network connection.
-
If you have more than one subscription available, select which subscription to attach this installation to
-
Click Done.
-
-
Click Finish configuration when you are done.
-
Log in to the system with the username and password you created during installation.
If you didn’t create a regular user, you will need to log in as root and create a user. See Troubleshooting and FAQ.
If you get a text-based login screen instead of a graphical one, see Troubleshooting and FAQ.
-
Select your preferred language.
For security and to save energy, the default configuration of Red Hat Enterpise Linux is to lock the screen and turn the screen off when idle. On a VM, it is best to disable these features since the host system will control screen locking and power saving.
To disable these features, from the desktop Application menu, select the System Tools group, then select Settings. Follow these steps in the Settings application.
-
Click the Privacy icon to bring up the Privacy dialog.
-
Click on Screen Lock to bring up the Screen Lock dialog.
-
Click on the On/Off switch to the right of Automatic Screen Lock.
-
Click the X in the upper right hand corner to dismiss the Screen Lock dialog.
-
Click the < button in the upper left corner of the Privacy dialog to go back to the main Settings screen.
-
Click on the Power icon to open the Power settings dialog.
-
Click the menu button to the right of Blank screen. Select Never from the list of choices.
-
Finally, Click the ‘X’ in the upper right hand corner to close the Settings application.
In this step, you will download and install the latest updates for your system from Red Hat. In the process, you will verify that your system has a current Red Hat subscription and is able to receive updates.
First, start a Terminal window from the Application menu. Then, after using su
to change to the root user ID, use subscription-manager
to verify that you have access to Red Hat software repositories.
$ su -
# subscription-manager repos --list-enabled
If you don’t see any enabled repositories, your system might not be registered with Red Hat or might not have a valid subscription. See Troubleshooting and FAQ for more information.
Now download and install any available updates by running yum update
. If updates are available, yum
will list them and ask if it is OK to proceed.
# yum update
In this step you will configure your system to obtain software from the Optional RPMs and RHSCL software repositories. The Optional RPMs repository includes a number of development packages. The RHSCL repository includes the both the RHSCL software collections as well as DTS (the Red Hat Developer Toolset).
# subscription-manager repos --enable rhel-server-rhscl-7-rpms
# subscription-manager repos --enable rhel-7-server-optional-rpms
VirtualBox Guest Additions provides a number of enhancements including shared folders, better video support and mouse pointer integration. The software is packaged as an ISO file, which will be used on the VM as a virtual CD. The VirtualBox desktop will load the virtual CD when you select Insert Guest Additions CD image from the Devices menu of the VM window. You should do this step after when Red Hat Enterprise Linux is running, after logging in, with the full graphical desktop running. The graphical desktop will prompt you to automatically run the software on the CD image.
Once the installation is complete reboot the VM. To do this using the command line:
# reboot
The default VirtualBox network configuration is for the VM to share the host system’s network connection(s) and IP address using network address translation (NAT). This is the easiest to manage and will be fine for many uses. Using NAT, the VM will be able to access resources on your network or the Internet. However services, such as a web server, running inside the VM won’t be directly accessible from outside of the VM.
You can make specific services on the VM accessible using port forwarding. For example you can configure port forwarding so that port 8080 on your host system maps to port 80 on the VM.
Alternatively, you can attach the VM to directly network by sharing the network adapter from the host system as a bridged network adapter. In this configuration, the VM gets its own IP address, usually using your network’s DHCP server. The VM appears on the network the same way a physical computer would with its own hardware MAC address. The host’s network adapter is shared by a device driver that is installed by VirtualBox. The VM’s virtual network adapter can only be bridged to one physical network adapter at a time. If your system has more than one network adapter you need to choose which one to attach to. If your system switches between wired and wireless connections, you will need to switch bridged adapters for the VM.
Networking, both physical and virtual, is a large topic beyond the scope of this guide. For more information see Virtual Networking in the VirtualBox User Manual.