This guide will walk you through the steps to install Amazon Linux on your local machine using VMware or VirtualBox, and how to change the default password using a seed.iso
file.
- VMware Workstation or VirtualBox installed on your machine.
- ISO file for Amazon Linux (download it from Amazon Linux 2 ISO Downloads.
- Download the Amazon Linux 2 Ova for VMware from the Amazon Linux 2 Ova File for VMware. (Click on amzn2-vmware_esx-2.0.20240916.0-x86_64.xfs.gpt.ova)
- Open your VMware
- Click on Workstation --> File --> Open and point it to the downloaded ova file.
We need the seed.iso
because Amazon Linux is set up to use SSH keys for login by default, which means you can’t log in with a password right away. By adding a user-data file inside the seed.iso, we can change this during the boot process—letting us set a password and enable password-based login, making it easier to access the system without needing SSH keys.
I have done these steps on Ubuntu 22:
-
meta-data file content (you can name the hostname as per your choice):
instance-id: iid-local01 local-hostname: amazon-linux
-
user-data file content (replace
newpassword
with your desired password):#cloud-config password: newpassword chpasswd: { expire: False } ssh_pwauth: True
To generate the seed.iso file, run the following command:
genisoimage -output seed.iso -volid cidata -joliet -rock user-data meta-data
- Open your virtual machine settings.
- Attach the
seed.iso
file as a CD/DVD drive in VMware or VirtualBox. - Boot your virtual machine with the
seed.iso
attached.
Once the virtual machine has booted, the new password you set in the user-data
file should be applied. Log in using the ec2-user
and the new password.
After successfully logging in, you can remove the seed.iso file from the VM settings since it’s no longer needed.
If the CD/DVD drive does not appear in the VMware settings, you can manually add it:
- Shut down the virtual machine if it is running.
- Open the VM settings window.
- Click on Add to add new hardware.
- Select CD/DVD Drive from the list of devices and click Next.
- Choose Use ISO image file and browse to select your
seed.iso
file. - Click Finish to add the CD/DVD drive.
- Ensure that Connect at power on is checked, and boot your virtual machine again.
If you want to share a folder between your host machine and the virtual machine, follow these steps:
-
Ensure VMware Tools are Installed:
- In the VMware menu, click on VM > Install VMware Tools. This will mount the VMware Tools ISO to the VM.
- In Amazon Linux, run the following commands to install the tools:
sudo yum install open-vm-tools -y sudo systemctl enable --now vmtoolsd
-
Set up Shared Folder:
- Go to the VMware Settings for your VM.
- Click on the Options tab.
- Select Shared Folders and choose Always enabled.
- Click on Add and browse to the folder on your host machine you want to share.
- Check Map as a network drive and Enable this share.
- Access the Shared Folder:
- Inside your virtual machine, shared folders are typically mounted under
/mnt/hgfs/
. You can access them by running:
cd /mnt/hgfs/ ls
- You should see the shared folder listed and can now use it to transfer files between your host and the VM.
- Inside your virtual machine, shared folders are typically mounted under
By following these steps, you will be able to install Amazon Linux on your local machine, change the default password, and set up a shared folder between your host and the virtual machine.
-
Make sure it is enabled:
sudo systemctl restart vmtoolsd
-
If you are having trouble to see shared folder on VM, try manually mount the folder again:
sudo mount -t fuse.vmhgfs-fuse .host:/ /mnt/hgfs -o allow_other