If you have a MacOS device with the new M1 or M2 chip, you might encounter issues with the previous installation procedure because Metasploitable3 machines are virtualized for Intel processors.
To install these virtual machines on MacOS with M1/M2, follow these steps:
1. Prerequisites
Installing UTM
UTM is a virtualization client that allows running virtual machines on M1 chips.
Download UTM from its official website by clicking on Download from GitHub and install the downloaded package.
Installing HomeBrew
HomeBrew is a package manager for MacOS that makes it easy to install a wide range of Open Source tools.
To install HomeBrew, run the following command in a terminal:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
Make sure you have the Xcode Command Line Tools installed. If not, execute the following command:
xcode-select --install
After installation, you should be able to run the brew
command. When you run brew doctor, you should see an output similar to the following:
Your system is ready to brew.
2. Downloading Metasploitable3
Download Metasploitable3 from the website shown in the previous video. Ensure you select the versions for VirtualBox.
Once the .zip
files are downloaded, follow the same procedure shown in the video to extract them.
3. Converting the Virtual Machines to UTM Format
At this point, the Metasploitable3 virtual machines for VirtualBox should be extracted. To make them compatible with UTM, you need to convert them. For this, you’ll use a tool called qemu.
Install qemu by running the following command in a terminal:
brew install qemu
Once installed, run the following command to convert the machines to the correct format:
qemu-img convert -f vmdk -O qcow2 ./metasploitable3-ub1404-disk001.vmdk ./metasploitable3-ub1404-disk001.qcow2
Note: The file metasploitable3-ub1404-disk001.vmdk
is located in the folder you extracted from metasploitable3-ubuntu. Ensure you specify the path where these files are located on your system.
4. Creating the Virtual Machine in UTM
Now that everything is ready, you can create the virtual machines. Follow these steps in UTM:
Open UTM.
Create a new virtual machine by clicking the + button and selecting Emulate.
Choose Other.
Click Skip ISO boot.
Reduce the RAM to 1024 MB.
Continue clicking Next until you reach the summary page. On this page, select Open VM Settings and then click Save.
A new window will open with the virtual machine options. In this window, you can modify the name.
Click on QEMU in the sidebar and uncheck UEFI Boot.
In the Drives section of the sidebar, select IDE Drive and delete it by clicking Delete Drive.
In the Drives section, click New Drive and then Import.
Select the .qcow2 file generated earlier with qemu.
Click Save and start the virtual machine.
At this point, you should be able to launch Metasploitable3 on your MacOS with the M1 chip.
Best regards,
Santiago