OpenHarmony开发者论坛

标题: 【工作准备】(一)Vmware虚拟机和Ubuntu安装 [打印本页]

作者: 诚迈_雨哥    时间: 2024-1-27 17:33
标题: 【工作准备】(一)Vmware虚拟机和Ubuntu安装
[md]# 前言

临渊羡鱼不如退而结网,想揭开OpenHarmony 的神秘面纱,看清代码内部实现,领略大佬的风采,请继续。首先在电脑上安装虚拟机,在虚拟机里面安装Linux操作系统。因为OpenHarmony要在此环境下下载代码、开发、编译、调试、测试、提交代码。

# 一、 安装路线

## 1. [避坑指南](#二、避坑指南)

## 2. [安装Vmware虚拟机](#三、安装Vmware虚拟机)

## 3. [在VMware虚拟机上安装Ubuntu Linux 操作系统](#四、安装Ubuntu操作系统)

# 二、避坑指南

## 1. 虚拟机命名、用户名称、路径不能有汉字

名称或者路径有汉字,导致输入失败或者安装失败

## 2. 虚拟机处理器内核总数(处理器数量X每个处理器的内核数量)不得超过电脑逻辑处理器总个数

* 太少时,下载代码和编译非常缓慢;
* 太多时,可能导致电脑卡死;
* 例如;我的电脑是8核,16个逻辑处理器,虚拟机的处理器数量选择1,每个处理器的内核数量选择12;

## 3. 虚拟机内存配置不得超过电脑内存

* 根据经验,虚拟内存=(电脑内存-6GB)/2。原因是虚拟机与电脑拷贝资料时,内存将会消耗2倍的虚拟机内存。
* 例如:我的电脑内存32GB,虚拟机分配内存13GB。

## 4. 选择磁盘容量

* 如果是做开发,磁盘空间配置至少400GB以上。因为截止2023年12月底,源代码占用53GB,编译输出一共需要108GB,编译时明确提示需要至少100GB空间,另外电脑上至少存放一套可执行的老代码。
* 如果有一天提示你磁盘空间不够用的时候,去扩容会比较麻烦。

## 5. 虚拟机安装目录

* 虚拟机安装目录不建议放在C盘,同时选择的其他分区越大越好,至少超过400GB。

# 三、安装Vmware虚拟机

## 1. 下载安装包

### 方式一:在官网下载VMware Workstation 16 Pro安装包

下载地址: https://www.vmware.com/cn/produc ... pro-evaluation.html

![1VmwareIntroduce.png](https://forums-obs.openharmony.c ... bceuc1lvhufhz3f.png "1VmwareIntroduce.png")

### 方法二:在软件管家搜索Vmware ,点一键安装即可

![2search_vmware.png](https://forums-obs.openharmony.c ... 6zarkds6sxn6nen.png "2search_vmware.png")

## 2. 安装Vmware虚拟机

**双击下载好的VMware安装包,按图指示逐步操作**

**![1install_vm.png](https://forums-obs.openharmony.c ... 9e64hdrrkaeq9nq.png "1install_vm.png")


![2install_vm.png](https://forums-obs.openharmony.c ... 34299vivt2e2mv7.png "2install_vm.png")



![3install_vm.png](https://forums-obs.openharmony.c ... ibm1ib0w04jiz0b.png "3install_vm.png")


![4install_vm.png](https://forums-obs.openharmony.c ... 5s1errrzss6fee1.png "4install_vm.png")



![5install_vm.png](https://forums-obs.openharmony.c ... lzh7salh30dhv7p.png "5install_vm.png")



![6install_vm.png](https://forums-obs.openharmony.c ... f097kl73aksvvl1.png "6install_vm.png")


![7install_vm.png](https://forums-obs.openharmony.c ... yky2b2mo7nbnok7.png "7install_vm.png")



![8install_vm.png](https://forums-obs.openharmony.c ... q9d8ytytybed2jq.png "8install_vm.png")



![9install_vm.png](https://forums-obs.openharmony.c ... 8dwtodisvhdlto6.png "9install_vm.png")



![10install_vm.png](https://forums-obs.openharmony.c ... fzwkmhzftwhkkod.png "10install_vm.png")



![11install_vm.png](https://forums-obs.openharmony.c ... wsf44jcfz2sfik8.png "11install_vm.png")


# 四、安装Ubuntu操作系统

**重启 Vmware,按图指示逐步操作**

![1install_ub.png](https://forums-obs.openharmony.c ... cwm9zlaamaecxaa.png "1install_ub.png")



![2install_ub.png](https://forums-obs.openharmony.c ... wscicii67b57o72.png "2install_ub.png")



![3install_ub.png](https://forums-obs.openharmony.c ... pwjepejjj22opxz.png "3install_ub.png")



![4install_ub.png](https://forums-obs.openharmony.c ... exol0b2x7suub2e.png "4install_ub.png")



![5install_ub.png](https://forums-obs.openharmony.c ... 6dptt70doq6z3zq.png "5install_ub.png")



![6install_ub.png](https://forums-obs.openharmony.c ... 0yejysb0bbbjyuo.png "6install_ub.png")

![7install_ub.png](https://forums-obs.openharmony.c ... xsfns0ppss1pos9.png "7install_ub.png")



![8install_ub.png](https://forums-obs.openharmony.c ... 36n47cc73p4j7c4.png "8install_ub.png")



![9install_ub.png](https://forums-obs.openharmony.c ... m1msqsjjjq8l2eq.png "9install_ub.png")



![10install_ub.png](https://forums-obs.openharmony.c ... dnapeudddcnpyad.png "10install_ub.png")



![11install_ub.png](https://forums-obs.openharmony.c ... shrzlbwqp5d5hrw.png "11install_ub.png")



![12install_ub.png](https://forums-obs.openharmony.c ... wrqqtkmh0t4ha3r.png "12install_ub.png")



![13install_ub.png](https://forums-obs.openharmony.c ... xsss64q5z64vr7x.png "13install_ub.png")

![14install_ub.png](https://forums-obs.openharmony.c ... ppvlskrp19q5k9r.png "14install_ub.png")



![15install_ub.png](https://forums-obs.openharmony.c ... mbzq95a3hq2dw5a.png "15install_ub.png")



![16install_ub.png](https://forums-obs.openharmony.c ... 8b66v63z8vtzbnb.png "16install_ub.png")



![17install_ub.png](https://forums-obs.openharmony.c ... 2ejobpjoppvop2u.png "17install_ub.png")



![18install_ub.png](https://forums-obs.openharmony.c ... f0wrryfjyq00f0j.png "18install_ub.png")



![19install_ub.png](https://forums-obs.openharmony.c ... yfjm678sy60ymf6.png "19install_ub.png")



![20install_ub.png](https://forums-obs.openharmony.c ... 2g6f68t63o7fft7.png "20install_ub.png")



![21install_ub.png](https://forums-obs.openharmony.c ... jrqz0o6ppn2nnoo.png "21install_ub.png")



![22install_ub.png](https://forums-obs.openharmony.c ... 3r3dhebedef3u33.png "22install_ub.png")



![23install_ub.png](https://forums-obs.openharmony.c ... l8xjjxesvoqzl7m.png "23install_ub.png")



![24install_ub.png](https://forums-obs.openharmony.c ... p8ecsstioiihrir.png "24install_ub.png")



![25install_ub.png](https://forums-obs.openharmony.c ... tb914wgjjjme2om.png "25install_ub.png")



![26install_ub.png](https://forums-obs.openharmony.c ... w3e93pmz60xg178.png "26install_ub.png")



![27install_ub.png](https://forums-obs.openharmony.c ... n3xyzlkh66qky32.png "27install_ub.png")



![28install_ub.png](https://forums-obs.openharmony.c ... w6cc75ccqdfl4eq.png "28install_ub.png")



![29install_ub.png](https://forums-obs.openharmony.c ... kdzkekjukao038i.png "29install_ub.png")



![30install_ub.png](https://forums-obs.openharmony.c ... lzve4zbcpkbf9ft.png "30install_ub.png")



![31install_ub.png](https://forums-obs.openharmony.c ... avoxjzmjj9wt972.png "31install_ub.png")



![32install_ub.png](https://forums-obs.openharmony.c ... encsojegu5ewgej.png "32install_ub.png")



![33install_ub.png](https://forums-obs.openharmony.c ... uvn9vu8e8pm4pl9.png "33install_ub.png")

![34install_ub.png](https://forums-obs.openharmony.c ... gwv6gz48omo54wy.png "34install_ub.png")


# 五、恭喜您 VMware虚拟机、Ubuntu操作系统安装成功!

至此,您已经迈入了OpenHarmony内核及子系统开发世界的第一步。虽然虚拟机安装了,但OpenHarmony想要下载代码、编译还缺少多个安装包(依赖库),请看下一章节《OpenHarmony 虚拟机环境配置》,加油!
[/md]




欢迎光临 OpenHarmony开发者论坛 (https://forums.openharmony.cn/) Powered by Discuz! X3.5