Setting up Rocky Linux 9 on VirtualBox is a great way to create a virtualized environment for system administration, development, and testing. However, the installation process is just the first step. To ensure your Rocky Linux system is running efficiently and securely, configuring it properly after installation is essential.
In this guide, we will walk you through the basic system setup after installing Rocky Linux 9 on VirtualBox. For a detailed, step-by-step walkthrough, be sure to watch the accompanying video here.
A Step-by-Step Guide :: Basic System Setup After Installing Rocky Linux 9 on VirtualBox
Why Is System Setup Important?
After installing Rocky Linux on VirtualBox, your system is not yet fully optimized for performance, security, or ease of use. The post-installation steps are crucial for configuring network settings, updating software, securing the system, and installing essential tools. A well-configured virtual machine (VM) ensures that your setup works smoothly and is secure for any tasks you plan to perform.
1. Initial System Update and Package Installation
The first step in any system setup is to update your Rocky Linux system to ensure that you have the latest patches and software updates. These updates provide essential security fixes and performance improvements.
- Open a terminal window and run the following commands to update your system:
This command will fetch the latest software and security updates. It is crucial to run updates regularly to ensure your system is up to date.
- After the update, reboot the system if required:
2. Install Essential Tools
After the system update, the next step is to install the essential tools you need for your environment. These tools include network utilities, text editors, and package managers that will make system administration easier.
Run the following command to install these tools:
- Vim is a powerful text editor.
- Wget and curl are useful for downloading files from the internet.
- Net-tools includes networking tools like
ifconfig
,netstat
, androute
.
3. Set Up Network Configuration
For your VM to communicate effectively with the host system and other networks, it’s important to configure the network settings.
- Check the current network interfaces by running:
- If you are using a static IP for your VM, you can configure it by editing the network configuration file located at
/etc/sysconfig/network-scripts/ifcfg-ens33
. Modify the file to match your network settings. - Restart the network service to apply the changes:
4. Set the Hostname
Setting the hostname is an important step to ensure that your system can be easily identified on the network.
- To set the hostname, run the following command:
Replace
my-rocky-linux
with your desired hostname. - You can check the hostname by running:
5. Install and Configure a Firewall
Security is essential, even for VMs. It’s highly recommended to enable and configure a firewall to protect your system from unwanted traffic.
- To install the firewall, use:
- Enable and start the firewall service:
- Check the status of the firewall:
- Allow necessary ports (e.g., SSH, HTTP, HTTPS) by running:
6. Enable SSH for Remote Access
If you plan to access your Rocky Linux VM remotely, enabling SSH is essential.
- Install the OpenSSH server package:
- Enable and start the SSH service:
- Verify that SSH is running by checking its status:
- To allow SSH access through the firewall, run:
7. Create User Accounts
For security reasons, it’s always better to create a separate user account for day-to-day tasks instead of using the root account.
- Create a new user by running:
- Add the user to the sudoers group to grant them administrative privileges:
8. Final Reboot
Once you’ve completed all the necessary configuration steps, reboot your system to ensure all changes take effect properly:
FAQs
Q1: How do I update Rocky Linux 9.5 after installation?
Run the command sudo dnf update -y
to update all packages and security patches.
Q2: How can I check the network interfaces on my system?
Use the ip a
command to view all available network interfaces.
Q3: What is the purpose of installing firewalld?
Firewalld is a dynamic firewall management tool that helps protect your system from unauthorized access.
Q4: How can I enable SSH access to my Rocky Linux VM?
Install OpenSSH by running sudo dnf install -y openssh-server
, then enable and start the SSH service using sudo systemctl enable --now sshd
.
Q5: How can I check if SSH is running on my system?
Use the command sudo systemctl status sshd
to verify the status of the SSH service.
Conclusion
Proper system setup after installing Rocky Linux 9.5 on VirtualBox ensures that your virtual environment is secure, efficient, and ready for use. From updating your system to configuring network settings, firewalls, and SSH access, each step plays a vital role in ensuring the system’s stability.
To help you set everything up easily, watch the step-by-step guide in the video. By following these instructions, you’ll have a well-configured Rocky Linux 9.5 VM that meets your needs.
See also:
Reset Jenkins Admin Username and Password
How to Check Your Linux OS Version