Try various Linux distributions with VMware ESXi arm edition + USB boot

At the beginning

VMware's ESXi arm edition now works with raspberry pi 4. The installation method is described in detail in Official, so you can follow it. However, I had to go back and forth to create a vm from there, so I'll write it down. However, I just searched for a method experimentally and it does not seem to be a formal method, so if there is a formula, I would appreciate it if you could comment. Also, USB booting was surprisingly easy, so I will report that as well.

Reference page

ESXi arm edition official

Ubuntu 20.10 aarch64

CentOS 8 aarch64 generic image

Fedora 33 aarch64 image

What to prepare

--raspberry pi 4 version ESXi arm edition Please install and check the operation according to Official. Select "Fling-on-Raspberry-pi.pdf" from the menu above the Download button on the left side of this page to download and you will find detailed instructions. In addition, Pi4 8GB or 4GB, SD card, SSD / HDD with USB connection are required for installation. --The Linux PC vm image must have enough HDD capacity to handle and qemu must be installed. The author did it in an environment where Ubuntu is running with an HDD attached to the Raspberry Pi 4. --Windows PC for various work

VM Create ① Ubuntu Edition

Ubuntu has an aarch64 installer ISO image that works and can be installed in the usual way. Fedora also has an installer ISO and I install it, but grab installation fails and it doesn't work.

(1) First, download the installer ISO from Ubuntu 20.10 aarch64 to your work PC.

(2) Select Storage from the left side of the ESXi screen of the browser to open the Data Store browser.

スクリーンショット 2020-10-31 101045.jpg

Open Upload and upload the downloaded ISO file.

スクリーンショット 2020-10-31 101244.jpg

(3) Create a VM. Select Virtural Machines-> Create / Register VM.

スクリーンショット 2020-10-31 102645.jpg

Select Create a new virtural machine next

スクリーンショット 2020-10-31 103023.jpg

Select an appropriate name and ESXi 7.0 virtural machine, Linux, Ubuntu Linux (64bit) next

スクリーンショット 2020-10-31 103504.jpg

Next, select a suitable storage (probably only one) next Then select the ISO file. First, set the CPU to about 2. Maybe 4 is impossible. The memory (which ESXi has taken all the time) should be about 2GB for the 4GB version. The HDD should not be too small in consultation with the disk you are using. If it is an experiment, it is OK by default. Make the CD / DVD Drive 1 choice at the bottom a Datastore ISO file. The file selection screen will appear, so select the file you uploaded earlier.

スクリーンショット 2020-10-31 104230.jpg

Make sure Connect is checked next

スクリーンショット 2020-10-31 104425.jpg

It ends with next and finish. I think that there is no particular problem for those who have experience with virturalbox.

(4) Start the newly created VM. Click Power on and follow the instructions.

VM Create ② CentOS Edition

On CentOS, when I searched for aarch 64, there is no installer ISO, and the installed disk raw image is distributed. I need to bring this to ESXi, but I made a trial and error here and succeeded in booting. First, as an image, the image for raspberry pi seems to be NG. Apparently the boot is special and does not boot. The generic image for Arm in general worked. The procedure is as follows.

(1) Preparation, open the ESXi ssh port. Open Manage of Navigator on the left side of the ESXi browser screen. Select TSM-SSH from the items and press Start. You can ssh when it becomes Running. There is also a habit of logging in. You can't open teratarm, select the host, write the username (root in this case), and then enter the password under it. Select Use Keyboard Interactive Authentication at the bottom of the menu. Next, the password entry screen will appear, so you can log in by entering the password. I'll use the console later.

スクリーンショット 2020-10-31 091724.jpg

スクリーンショット 2020-10-31 092222.jpg

The storage for storing VM data is as follows.

# cd /vmfs/volumes/datastore1/

(1) Download the raw image to your working Linux PC and unzip it.

$ wget https://people.centos.org/pgreco/CentOS-Userland-8-stream-aarch64-generic-Minimal/CentOS-Userland-8-stream-aarch64-generic-Minimal-sda.raw.xz
$ unxz CentOS-Userland-8-stream-aarch64-generic-Minimal-sda.raw.xz

(2) Use qemu to create a vmdk file, which is a disk image for VMware.

$ qemu-img convert -f raw -O vmdk CentOS-Userland-8-stream-aarch64-generic-Minimal-sda.raw centos.vmdk

(3) Use SCP to transfer the vmdk file to ESXi. Notice that the ssh port in (0) is open.

$ scp centos.vmdk root@<ESXi address>:/vmfs/volumes/datastore1/

(4) Go to the ESXi ssh console opened in (1) and check that the transferred file exists. Then do the following:

# vmkfstools -i centos.vmdk centos_2.vmdk
Destination disk format: VMFS zeroedthick
Cloning disk 'centos.vmdk'...
Clone: 100% done.

This is because the .vmdk file that can be created with qemu is a version that does not work on ESXi and needs to be converted.

(5) Now you can finally work from the browser. Create a VM. Select Virtural Machines-> Create / Register VM. Select CentOS 8 as the OS. In Customize Settings, press the x on the far right of Hard Disk 1 to erase it. Register a new hard disk instead. You will be able to select files with Add hard disk-> Existing hard disk, so select the converted vmdk (in this case centos_2.vmdk). After that, make some adjustments and complete Create. After that, select the VM and start it, and the OS should start.

Fedora 33 It started in exactly the same way as CentOS. The file used:

$ wget https://dl.fedoraproject.org/pub/fedora/linux/releases/33/Workstation/aarch64/images/Fedora-Workstation-33-1.3.aarch64.raw.xz

Boot from ESXi USB HDD

The official ESXi installation will also require an SD card for the next boot. I thought it was a waste to have the Raspberry Pi 4 USB bootable, so I considered it a little. At first, I tried to make space by shifting the partition of the HDD of ESXi little by little and put the boot of the SD card, but gparted does not work. If you look closely, you will find an HDD BOOT partition with a bootable flag. If you look inside, you will find EFI boot related items, and only the EFI directory is directly underneath. I wondered if it would work if I booted the Raspberry Pi here, that is, put the contents of the SD card, and when I tried it, I booted without the SD card. It's a little more convenient. For those who don't know how to do it in the above sentence. (1) Copy the contents of the SD card to your Linux PC. Please use a USB memory etc. (2) Connect the ESXi HDD to the Linux PC. Check with fdisk -l.

$ sudo su
# fdisk -l

Check the device name of the connected HDD. Here, it is / dev / sdb.

(3) Mount / dev / sdb1. Assuming that the copied SD card file is under / home / pi / boot /, it will be as follows.

# mount /dev/sdb1 /mnt
# cp -r /home/pi/boot/* /mnt
# umount /mnt

Try removing it and booting without an sd card.

At the end

Since VMware has been used as a user at work, it is quite fun to be able to build a host OS environment that can be destroyed at worst and to experiment with various things. Personally, I think it would be nice if the virtualbox host could be Pi4.

Recommended Posts

Try various Linux distributions with VMware ESXi arm edition + USB boot
USB boot with Raspberry Pi 4 Model B (3) LVM edition
Try various things with PhantomJS
Create a permanent write area on Kali Linux with USB memory boot