Install RHEL in VirtualBox (on Mac Os)
This step by step tutorial on how to install RHEL 7 as a VirtualBox image on a MacOs.
❗️ Before starting be sure that you have already download the RHEL DVD BINARY ISO, and that your machine currently has internet access.
Of course you should also have installed VirtualBox on your machine.
Create Virtual Machine
We first need to create a VirtualBox image
- Open virtualbox and click on “New”
- Enter the following informations
- Name : RHEL 7 (or anything else, it’s up to you)
- Type : Linux
- Version : Red Hat (64-bit)
- Choose Memory Size (4 GB in my case)
- Create The disk image (where the datas will be stored) (I use 8.0 GB in a dynamically allocated size)
- Then click on create
- The Virtual Image is now created we need to install the OS
Install RedHat Enterprise Linux 7
Add DVD to Image
On the Image in Virtual Box, right click and choose settings:
Then go to the “Storage Menu” and click on “Empty” below “Controller: IDE” Then on the 💿 icon and click on "Choose Virtual Optical Disk File…"
Select the RHEL DVD BINARY ISO
Click Ok
Start RHEL Installation
❗️ Remember that to have your mouse out of the VM you need to press the "HOST key" which is the left "COMMAND" key of the keyboard on a MAC
Now you can start the virtual machine and install RHEL on it
So now you have to follow the instructions … here is what I did, maybe you will have to adapt to your needs …
Configure the network, in my case I use default configuration, and I changed the host name to rhel.local :
Then configure the disk, I use all disk, and automatic partitionning
Now start the installation by clicking "Begin Installation button …
Change Root Password (I used “password” … 😉 )
And I created a user : remi with sudo access (click on “Make the user an admonistrator”).
Now Reboot …
Then you can login …
Configure VirtualBox for SSH
As the network of the virtual machine is, by default with virtual box, natted to your host, if you want to access your Virtual machine through SSH for exemple, you need to use Port Forwarding :
When the Virtual machine is running, you can click on the small network icon at the bottom of the window, and click "Network Settings" :
Then in the adpater configuration, unfold “Advanced” settings, and click on "Port Forwarding"
And add a port forwarding from port 2222 of your local computer to the port 22 (ssh) of the virutal machine :
Then open a terminal and type the following command to connet to your redhat system
$ ssh remi@127.0.0.1 -p 2222
The authenticity of host '[127.0.0.1]:2222 ([127.0.0.1]:2222)' can't be established.
ECDSA key fingerprint is SHA256:WkCjIECzhX5cTnA5AVKaxnmM3Fki7DdtgKTgDOmlCa8.
Are you sure you want to continue connecting (yes/no)? yes
[remi@rhel ~]$
Register your RedHat System
Of course you need to have a valid registration from redhat.
- Login on your platform
- Sudo to root
- Execute Registration :
[remi@rhel ~]$ sudo su -
[sudo] password for remi:
[root@rhel ~]# subscription-manager register
Registering to: subscription.rhsm.redhat.com:443/subscription
Username: your_rh_login
Password: your_rh_password
The system has been registered with ID: xxxxxxxx-yyyy-xxxx-yyyy-azazazazazaz
- Try to install wget …
[root@rhel ~]# yum install wget
Loaded plugins: product-id, search-disabled-repos, subscription-manager
This system is registered with an entitlement server, but is not receiving updates. You can use subscription-manager to assign subscriptions.
There are no enabled repos.
Run "yum repolist all" to see the repos you have.
To enable Red Hat Subscription Management repositories:
subscription-manager repos --enable <repo>
To enable custom repositories:
yum-config-manager --enable <repo>
- List all available subscription :
[root@rhel ~]# subscription-manager list --available
+-------------------------------------------+
Available Subscriptions
+-------------------------------------------+
Subscription Name: Red Hat OpenShift, Standard Support (10 Cores, NFR, Partner Only)
Provides: Red Hat OpenShift Enterprise Application Node
Red Hat JBoss Core Services
Red Hat Software Collections (for RHEL Server)
Red Hat Enterprise Linux Fast Datapath
Red Hat Enterprise Linux Fast Datapath Beta
Oracle Java (for RHEL Server) - Extended Update Support
Red Hat OpenShift Enterprise JBoss EAP add-on
Red Hat OpenShift Container Platform
JBoss Enterprise Application Platform
Red Hat JBoss AMQ Clients
JBoss Enterprise Web Server
Oracle Java (for RHEL Server)
Red Hat OpenShift Enterprise Client Tools
Red Hat CloudForms Beta
Red Hat Enterprise Linux Server
Red Hat Enterprise Linux Atomic Host
Red Hat Software Collections Beta (for RHEL Server)
Red Hat OpenShift Enterprise Infrastructure
Red Hat CloudForms
SKU: SER1111
Contract: 11111111
Pool ID: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Provides Management: Yes
Available: 10
Suggested: 1
- Attach your system to the pool :
subscription-manager attach --pool=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Successfully attached a subscription for: Red Hat OpenShift, Standard Support (10 Cores, NFR, Partner Only)
- Install wget :
[root@rhel ~]# yum install wget
Loaded plugins: product-id, search-disabled-repos, subscription-manager
rhel-7-server-rpms | 3.5 kB 00:00:00
(1/3): rhel-7-server-rpms/7Server/x86_64/group | 709 kB 00:00:01
(2/3): rhel-7-server-rpms/7Server/x86_64/updateinfo | 2.5 MB 00:00:07
(3/3): rhel-7-server-rpms/7Server/x86_64/primary_db | 47 MB 00:00:12
Resolving Dependencies
--> Running transaction check
---> Package wget.x86_64 0:1.14-15.el7_4.1 will be installed
--> Finished Dependency Resolution
Dependencies Resolved
===============================================================================================================================================
Package Arch Version Repository Size
===============================================================================================================================================
Installing:
wget x86_64 1.14-15.el7_4.1 rhel-7-server-rpms 547 k
Transaction Summary
===============================================================================================================================================
Install 1 Package
Total download size: 547 k
Installed size: 2.0 M
Is this ok [y/d/N]: y
Downloading packages:
warning: /var/cache/yum/x86_64/7Server/rhel-7-server-rpms/packages/wget-1.14-15.el7_4.1.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID fd431d51: NOKEY
Public key for wget-1.14-15.el7_4.1.x86_64.rpm is not installed
wget-1.14-15.el7_4.1.x86_64.rpm | 547 kB 00:00:01
Retrieving key from file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release
Importing GPG key 0xFD431D51:
Userid : "Red Hat, Inc. (release key 2) <security@redhat.com>"
Fingerprint: 567e 347a d004 4ade 55ba 8a5f 199e 2f91 fd43 1d51
Package : redhat-release-server-7.4-18.el7.x86_64 (@anaconda/7.4)
From : /etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release
Is this ok [y/N]: y
Importing GPG key 0x2FA658E0:
Userid : "Red Hat, Inc. (auxiliary key) <security@redhat.com>"
Fingerprint: 43a6 e49c 4a38 f4be 9abf 2a53 4568 9c88 2fa6 58e0
Package : redhat-release-server-7.4-18.el7.x86_64 (@anaconda/7.4)
From : /etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release
Is this ok [y/N]: y
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Installing : wget-1.14-15.el7_4.1.x86_64 1/1
rhel-7-server-rpms/7Server/x86_64/productid | 2.1 kB 00:00:00
Verifying : wget-1.14-15.el7_4.1.x86_64 1/1
Installed:
wget.x86_64 0:1.14-15.el7_4.1
Complete!
[root@rhel ~]#
Ok, so now you can use your system.