If you have a Mac with an M1, M2, or M3 chip, you may encounter an issue when trying to use VirtualBox. This is because VirtualBox does not support macOS on these newer Apple Silicon processors. Instead, you might see an error message while attempting to install VirtualBox on your macOS. For those who want to run Linux on macOS, UTM is a powerful alternative. It’s a virtualization tool designed specifically for macOS, making it easy to run Linux virtual machines. In this guide, we’ll walk through installing CentOS on macOS using UTM, step-by-step.
Step 1: Download CentOS
First, download the CentOS ISO file, which you can find on the official CentOS download page here. It’s best to use the latest version; for instance, CentOS Stream 9 is a solid choice for stability and compatibility.
Step 2: Download and Install UTM
You can download UTM from its official site here. UTM is free and straightforward to install, offering a friendly interface for macOS users.
Step 3: Set Up the Virtual Machine in UTM
- Open UTM, and select “Create a New Virtual Machine.”
- Choose the “Virtualize” option, as this setup uses a virtualized environment.
- Select “Linux” as the OS type.
- Click “Browse” to locate the CentOS ISO file you downloaded, then select it.
- Click “Continue” through the next few setup screens.
- When prompted, click “Save” to finalize your setup.
- Finally, click “Run” to launch your new virtual machine.
Step 4: Begin Installing CentOS
- In the UTM window, select “Install CentOS Stream 9.”
- Choose your preferred language, such as “English.”
- You’ll be redirected to the installation setup screen. Here, focus on filling out “Root Password” and “Installation Destination.”
- Click on “Root Password” to create a password for your root user. Make sure to check “Allow root SSH login with password,” then click “Done.”
- Next, select “Installation Destination,” ensure that your local standard disk is selected, and click “Done.”
- Once all setup steps are complete, click “Begin Installation.”
Step 5: Reboot After Installation
After installation finishes, you’ll see the option to reboot the system. However, upon reboot, you may be directed back to the installation screen. Don’t worry! Just close the UTM window and power off the VM. Then, clear the installation data, restart the virtual machine, and log in.
Once you log in, you’ll see the CentOS desktop, ready for final setup:
- Follow the setup prompts, clicking “Start Setup.”
- Skip any unnecessary steps until reaching profile creation.
- Enter your profile information, then set your password.
- Finish the setup, and CentOS is ready for use!
Testing SSH from macOS to CentOS
Now that CentOS is installed, you may want to set up SSH for easier access.
Open CentOS and ensure all packages are updated by running:
Confirm that
openssh-server
is installed:If it’s not installed, add it with:
Check the VM’s IP address by running:
Look for the “inet” entry to find the private IP (e.g.,
192.168.64.8
).Go back to your macOS terminal, and connect via SSH:
This command should open an SSH session, connecting your macOS terminal to your CentOS VM.
Summary
While UTM is one option for running Linux on macOS, other methods include using cloud services like AWS or Google Cloud. UTM, however, provides an easy, offline way to virtualize Linux on your local machine. Hopefully, this guide simplifies the process and helps you get your Linux VM up and running efficiently!
0 comments:
Post a Comment