Successfully built virtual environment on Mac M1!　


■ Preface

A year ago (May 2022), I wrote the following article in which I described the great difficulty I had in trying to set up a virtual environment on a Mac M1.

The story of how I lost half a day trying to set up a virtual environment on a Mac M1.　→ 
https://qiita.com/naiveprince0507/items/c32fea219e5dc0e0a353

In the above article, I tried all environments except the paid version of Parallel Desktop, but as a result, I came to the conclusion that it was completely useless except for UTM. 
However, after this article, while continuing to use UTM, I discovered various glitches.
I found many problems, such as the inability to copy and paste text between the host machine and the guest OS, not to mention the often-mentioned slowdown, and finally gave up using UTM after less than two weeks.

■ The Mac M1's reputation among Engineers for its virtualized environment

It is impossible to build a virtual environment on a Mac M1! 
It is whispered secretly among engineers that "You can't build a virtual environment on a Mac M1!
It is fatal to engineers that they cannot build a virtual environment.
(For ordinary users who only use the Internet, e-mail, or MS Office, Mac M1 is still enough.)
I myself thought, "If I can't build a VM instance environment, how about a Docker environment?" 
I tried to build a virtual environment with Docker Desktop and Rancher Desktop, but as a conclusion, it was not possible.
(Various errors occurred, and neither Docker Desktop nor Rancher Desktop can be used in the Mac M1 environment.)
Therefore, when I built a virtual instance environment or a Docker environment, I built and operated it on cloud services such as AWS or GCP. (However, this is a hassle and costly.)

■ A virtualization framework called OrbStack

Just a few days ago (March 24, 2023), a Beta version of a framework called OrbStack was released worldwide, and since it is a Beta version, it is free to use.　You can read about the background and overview in this article.

https://applech2.com/archives/20230324-orbstack-run-docker-and-linux-on-your-mac.html


■ Verification of OrbStack　
In conclusion, it works!　(Excellent!)
You can download it from the official site below.
There are frameworks for Apple Silcon and Intel, so choose the former.
→ https://orbstack.dev/

The following is the proof document. In case you are wondering, I installed OpenJDK17 as a trial, and it can be installed just like normal Linux installation.
![名称未設定8.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/1665829/b19220ff-9943-a9a3-6646-87ba493a08e6.png)
It is done properly. Impressed!

```
user_X@ubuntutest:/Users/user_X/OrbStack/ubuntu_test$ uname
Linux
user_X@ubuntutest:/Users/user_X/OrbStack/ubuntu_test$ ls
Applications Users boot home mnt proc sbin tmp
Library Volumes dev lib opt root srv usr
System bin etc media private run sys var
user_X@ubuntutest:/Users/user_X/OrbStack/ubuntu_test$ java -version
openjdk version "17.0.6" 2023-01-17
OpenJDK Runtime Environment (build 17.0.6+10-Ubuntu-0ubuntu122.10)
OpenJDK 64-Bit Server VM (build 17.0.6+10-Ubuntu-0ubuntu122.10, mixed mode, sharing)
user_X@ubuntutest:/Users/user_X/OrbStack/ubuntu_test$ uname
Linux
user_X@ubuntutest:/Users/user_X/OrbStack/ubuntu_test$ 
user_X@ubuntutest:/Users/user_X/OrbStack/ubuntu_test$ 
user_X@ubuntutest:/Users/user_X/OrbStack/ubuntu_test$ 
```
■ Finally
After a little use, it looks perfect.
However, since it is a Beta version, it is expected to be paid for eventually.