嵌入式学习之Linux入门篇——使用VMware创建Unbuntu虚拟机

目录

主机硬件要求

VMware 安装

安装Unbuntu 18.04.6 LTS

新建虚拟机

进入Unbuntu安装环节


主机硬件要求

内存最少16G
硬盘最好分出一个单独的盘,而且最少预留200G,可以使用移动固态
操作系统win7/10/11

VMware 安装

版本:VMware Workstation 17 Pro

下载地址:Download VMware Workstation Pro

安装教程:网上相关的教程很多自己搜索一下

安装Unbuntu 18.04.6 LTS

准备工作:下载ubuntu

版本:ubuntu-18.04.6-desktop-amd64

下载地址:

中科大源:Index of /ubuntu-releases/ (ustc.edu.cn)

阿里云源:ubuntu-releases安装包下载_开源镜像站-阿里云 (aliyun.com)

官方(很慢不推荐):Get Ubuntu | Download | Ubuntu

从阿里云镜像 站下载速度快,并且镜像里内置了国内的apt源,后续也比较顺利。

新建虚拟机

点VMware文件菜单,新建虚拟机

选择自定义

直接下一步

注意这里,不要选择简易安装,去选iso,我们选择稍后安装操作系统

操作系统类型选择Linux,版本选择Ubuntu 64位

给虚拟机起个名字,并且注意这里的路径是虚拟机存放的路径,确保磁盘有200G以上的空间,不然后期会比较麻烦。我直接装在了移动固态上。

CPU核数,看着给吧,我有4物理核2线程,给虚机分一半,2核2线程

关键点,内存给到16G最少,内存小了编译报错哦

网络设置,使用桥接网络,后期虚拟机和物理机在网络里是平级关系

I/O控制器默认

硬盘种类不管你放的是哪种,统一都选NVME没问题

创建磁盘,选择新建

选择给500G,这个是个最大大小,虚机不会直接占掉500G空间的,不要勾选立即分配所有磁盘空间。

指定磁盘文件的名字

一路下一步,到完成。

可以看到虚拟机已创建好了,此时虚机里还没有操作系统。

点击编辑虚拟机设置,把处理器里,虚拟化引擎3个√都打上。如果启动失败,根据报错信息,再去掉导致报错的项即可。这个和不同人的主机硬件有关。

选择CD/DVD,选择使用ISO映像文件,就相当于给虚拟机光驱里放了操作系统的光盘。我把Unbuntu的iso放在了相应路径下


设置完成后,点确定。
回到主页,点击 开启此虚拟机


进入Unbuntu安装环节

虚机会从ISO引导,进入Unbuntu安装引导界面
如下图所示,默认是英文的,在左侧的树选择中文

选择中文

选择最小安装,节省资源

安装类型选择,清除整个磁盘并安装Unbuntu。也i勾选Ubuntu新安装中使用Lvm
选择lvm卷管理,对后期虚机路径下空间不足的情况,可以方便动态扩展。

地点随便选

指定系统用户、密码。

漫长的等待ing………………

完成后会提示重启。注意重启时,最好选择关闭虚拟机

然后进入编辑虚拟机设置,将CD/DVD改为 自动监测,确定后。再启动虚拟机。即可完成安装。

注意刚进入系统,如果网络正常,则立即会提示系统升级,选择稍后升级。总之千万别升级!

  • 15
    点赞
  • 25
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
CarpVM 是一个用 C 语言编写的小型虚拟机。可以嵌入在应用程序中使用。 包含的指令集有: HALT (code): Halts and attempts to clean up stack, data memory, and label memory before exiting with given exit code. NOP (): Does nothing. Seriously. LOAD (reg, val): Loads given integer value into given register. MOV (dst, src): Copies contents of src register into dst register. ADD (): Pops the top two integers from the stack and pushes their sum. SUB (): Pops the top two integers from the stack and pushes the difference (lower minus upper). MUL (): Pops the top two integers from the stack and pushes their product. MOD (rega, regb): Computes rega % regb and stores in ERX. NOT (reg): Computes bitwise NOT of reg and stores in reg. XOR (): Pops the top two integers from the stack and XORs them. OR (): Pops the top two integers from the stack and ORs them. AND (): Pops the top two integers from the stack and ANDs them. INCR (reg): Increments value in given register. DECR (reg): Decrements value in given register. INC (): Increments the value at the top of the stack. DEC (): Decrements the value at the top of the stack. PUSHR (reg): Pushes value in given register. PUSH (val): Pushes given value. POP (val): Pops an integer from the stack and dumps it into GBG. CMP (): Pops the top two integers from the stack and checks if equal. 0 means equal. Result will be pushed onto the stack. MOV (rega, regb): Move value in rega to regb. JZ (addr): Jumps to given absolute address if top of the stack is 0. RJZ (diff): Adds differential to current EIP (relative jump) if top of the stack is 0. JNZ (addr): Jumps to given absolute address if top of the stack is not 0. RJNZ (diff): Adds differential to current EIP (relative jump) if top of the stack is not 0. JMP (addr): Jumps to given absolute address. RJMP (diff): Adds differential to current EIP (relative jump). DBS (key, val): Sets data memory at key (string pointer) to given value. DBG (key, reg): Gets value from data memory at key (string pointer) and dumps it into given register. CALL (key, nargs): Save state and set EIP to value in data memory at key. RET (val): Push return value and load state. PREG (reg): Prints contents of given register. PTOP (): Peeks top of stack and prints top value. 标签:CarpVM
搭建K8s集群一般需要至少两个节点,你可以在Ubuntu虚拟机上搭建一个包含两个节点的集群。下面是一个简单的流程: 1. 在Ubuntu虚拟机上安装Kubernetes和Docker: ``` sudo apt-get update sudo apt-get install docker.io sudo apt-get install -y apt-transport-https curl curl -s https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key add - sudo touch /etc/apt/sources.list.d/kubernetes.list echo "deb http://apt.kubernetes.io/ kubernetes-xenial main" | sudo tee -a /etc/apt/sources.list.d/kubernetes.list sudo apt-get update sudo apt-get install -y kubelet kubeadm kubectl ``` 2. 初始化K8s集群,并将第一个节点设置为主节点: ``` sudo kubeadm init --pod-network-cidr=10.244.0.0/16 ``` 3. 安装网络插件: ``` sudo kubectl apply -f https://raw.githubusercontent.com/coreos/flannel/master/Documentation/kube-flannel.yml ``` 4. 将其他节点加入到集群中: ``` sudo kubeadm join <主节点IP>:6443 --token <token> --discovery-token-ca-cert-hash sha256:<hash> ``` 5. 部署一个Deployment: ``` sudo kubectl create deployment nginx --image=nginx ``` 6. 部署一个Service: ``` sudo kubectl expose deployment nginx --port=80 --type=LoadBalancer ``` 7. 通过Service的IP地址访问部署的Nginx服务。 8. 进行弹性部署,可以通过以下命令来修改Deployment的副本数: ``` sudo kubectl scale deployment nginx --replicas=3 ``` 以上是一个简单的K8s集群搭建流程,可以根据实际需要进行适当的修改。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

玄奕子

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值