Try running Amazon Linux 2 on-premises (VM on your local PC).

1. Prerequisite environment

This time, create it in the following environment. Please read the contents according to the environment.

-Create a VM image directly in C: \ VM \ testvm01 on Windows 10 using WSL (Ubuntu).

-The hypervisor uses Hyper-V.

-The Hyper-V network uses a bridge.

- The IP address, default gateway, and referenced DNS of the virtual machine to be created must be issued by some DHCP.

For the time being, the purpose is to move it, so loosen the security

2. Install the commands required for the work.

$ sudo apt install genisoimage unzip

3. Create and move the directory to create the VM image

$ mkdir -p /mnt/c/VM/testvm01
$ cd /mnt/c/VM/testvm01

4. Create seed.iso

This time, create seed.iso with the following settings

Setting items Set value
hostname testvm01
Login with SSH password authentication Effectiveness
Initial user(ec2-user)Login password amazon

4.1. Create meta-data and user-data

$ cat << EOF > meta-data
local-hostname: testvm01
EOF

$ cat << EOF > user-data
cloud-config
ssh_pwauth: True
chpasswd:
  list: |
    ec2-user:amazon
EOF

* The comment [# cloud-config] on the first line of user-data cannot be omitted

4.2. Create seed.iso from meta-data and user-data

$ genisoimage -output seed.iso -volid cidata -joliet -rock user-data meta-data

4.3. Delete unnecessary meta-data and user-data

$ rm -i meta-data user-data

5. Create a virtual disk image

$ curl -LO https://cdn.amazonlinux.com/os-images/2.0.20201111.0/hyperv/amzn2-hyperv-2.0.20201111.0-x86_64.xfs.gpt.vhdx.zip
$ unzip amzn2-hyperv-2.0.20201111.0-x86_64.xfs.gpt.vhdx.zip
$ rm -i amzn2-hyperv-2.0.20201111.0-x86_64.xfs.gpt.vhdx.zip

6. Create a virtual machine

This time, create a new virtual machine with the following settings in Hyper-V Manager. Please read the contents as necessary.

6.1. Virtual Machine Creation Wizard Settings

1.png

2.png

3.png

4.png

5.png

6.png

6.2. Attach and boot settings for seed.iso

After creating the virtual machine, attach seed.iso and set the boot device (startup) order to HDD priority.

7.png

8.png

7. Operation check

-Start the virtual machine and log in image.png

・ Confirmation of IP address image.png

・ Login with SSH image.png

8. Permanent attachment of seed.iso

Seed.iso may be detached when the virtual machine is stopped or restarted by the hypervisor. Follow the steps for each hypervisor to make the seed.iso attachment permanent.

9. Reference

Run Amazon Linux 2 as a virtual machine on-premises https://docs.aws.amazon.com/ja_jp/AWSEC2/latest/UserGuide/amazon-linux-2-virtual-machine.html

Recommended Posts

Try running Amazon Linux 2 on-premises (VM on your local PC).
Try installing OpenAM on Amazon Linux
Try running Amazon Timestream
Try NeosVR on Linux
Publish your Django app on Amazon Linux + Apache + mod_wsgi
Install Linux on your Chromebox
Put jenv on Amazon Linux
Install tomcat 5.5 on Amazon Linux.
Install Linux (CentOS) on your PC using a USB stick
Use sshpass on Amazon linux2
Install Homebrew on Amazon Linux 2
Install strongSwan 5.9.1 on Amazon Linux 2
Try to log in to Netflix automatically using python on your PC
Install Python Pillow on Amazon Linux
Try running tensorflow on Docker + anaconda
Install oracle java8 on amazon linux2
Try implementing k-NN on your own
Install pyenv on EC2 (Amazon Linux)
[Note] Install Imagick on Amazon Linux2
[Note] Run Django on Amazon Linux 2
Try running Jupyter Notebook on Mac
Run docker-compose on Amazon Linux2 on ARM64
Introduce Python 3.5.2 environment on Amazon Linux
Try installing OpenCV 3.0 on your AMI
Run cron on Amazon Linux (set on Linux)
The story of running the asp.net core 3.1 app on arm64 version Amazon Linux 2
Install Python3 and Django on Amazon Linux (EC2) and run your web server
I'll install Ruby on EC2 (Amazon Linux2) 2020
Use Numpy, Scipy, scikit-learn on Amazon Linux
How to update php on Amazon linux 2
Build an LNPP environment on Amazon Linux 2
Learn sshd_config and authorized_keys (on Amazon Linux 2)
Upgraded mysql on Cloud9 (Amazon Linux) (5.5 to 5,7)
5 reasons to install Linux on your laptop.
How to install Anisble on Amazon Linux 2
Dockerfile: Install Docker on your Linux server
Try running PlaidML image judgment on Mac
Run Keycloak on Amazon Linux 2 without Docker
Install Python 3.8, Pip 3.8 on EC2 (Amazon Linux 2)
Try running Kobuki's 3D simulator on ROS
Try running a "newly infected number visualization app" using Streamlit on Amazon EC2