官网下载地址 vmware workstation:
Download VMware Workstation Pro
也可以下载提供的安装包。
链接:百度网盘 请输入提取码
提取码:au74
一、Ubuntu 安装
安装构建依赖项,打开您的系统终端并运行以下命令:
sudo apt update
sudo apt install build-essential linux-headers-generic
找到该文件,运行命令给文件权限(注意文件名,chmod +X
后边跟的是文件名,输入前几个字符按下tab键补全即可):
chmod +x VMware-Workstation-Full-16.2.4-20089737.x86_64.bundle
运行安装命令:
sudo ./VMware-Workstation-Full-16.2.4-20089737.x86_64.bundle
输入密码完成安装。
点击打开软件开始安装程序。
全部选择我接受:
后边全部默认选择 yes ,还有几个没放上截图;
后边需要输入激活密钥(自行百度一下,一搜一大片)。
最后安装成功进入界面:
到这里就安装完成了。
如果主要卸载VMware workstation。
执行如下命令确认正在运行的产品名称(如Workstation 还是 Player):
sudo /usr/bin/vmware-installer -l
如果是player执行:
sudo /usr/bin/vmware-installer -u vmware-player
咱们这里安装和卸载的是VMware workstation所以执行下边这个命令:
$ sudo /usr/bin/vmware-installer -u vmware-workstation
会询问你是否删除:
All configuration information is about to be removed. Do you wish to
keep your configuration files? You can also input ‘quit’ or ‘q’ to
cancel uninstallation. [yes]:
输入yes回车即可:
卸载成功。
二、RedHat 安装
搭建软件仓库:
[root@rhel8 ~]# mount /dev/sr0 /mnt/
mount: /mnt: /dev/sr0 already mounted on /run/media/root/RHEL-8-0-0-BaseOS-x86_64
[root@rhel8 ~]# cat /etc/yum.repos.d/iso.repo
[aa]
name = aa
baseurl = file:///mnt/BaseOS
gpgcheck=0
[bb]
name = bb
baseurl = file:///mnt/AppStream
gpgcheck=0
网络配置:
[root@rhel8 ~]# ifconfig ens256
ens256: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.199.106 netmask 255.255.255.0 broadcast 192.168.199.255
inet6 fe80::2d72:dc93:53ef:4d6 prefixlen 64 scopeid 0x20<link>
ether 00:0c:29:c9:d2:d3 txqueuelen 1000 (Ethernet)
RX packets 1166 bytes 225637 (220.3 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 200 bytes 21050 (20.5 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
[root@rhel8 ~]# route -ne
Kernel IP routing table
Destination Gateway Genmask Flags MSS Window irtt Iface
0.0.0.0 192.168.199.1 0.0.0.0 UG 0 0 0 ens256
192.168.122.0 0.0.0.0 255.255.255.0 U 0 0 0 virbr0
192.168.199.0 0.0.0.0 255.255.255.0 U 0 0 0 ens256
准备安装光盘和vmware workstation for linux:
[root@rhel8 ~]# ls VMware-Workstation-Full-15.5.5-16285975.x86_64.bundle
VMware-Workstation-Full-15.5.5-16285975.x86_64.bundle
[root@rhel8 ~]# ls rhel-8.0-x86_64-dvd.iso
rhel-8.0-x86_64-dvd.iso
检查你的cpu是否支持虚拟化:
[root@rhel8 ~]# lscpu | grep vmx
Flags: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge
mca cmov pat pse36 clflush mmx fxsr sse sse2 ss ht syscall nx pdpe1gb rdtscp
lm constant_tsc arch_perfmon nopl xtopology tsc_reliable nonstop_tsc cpuid
pni pclmulqdq vmx ssse3 fma cx16 pcid sse4_1 sse4_2 x2apic movbe popcnt
tsc_deadline_timer aes xsave avx f16c rdrand hypervisor lahf_lm abm
3dnowprefetch cpuid_fault invpcid_single pti ssbd ibrs ibpb stibp tpr_shadow
vnmi ept vpid fsgsbase tsc_adjust bmi1 avx2 smep bmi2 invpcid mpx rdseed adx
smap clflushopt xsaveopt xsavec xsaves arat flush_l1d arch_capabilities
[root@rhel8 ~]# lscpu | grep svm
[root@rhel8 ~]#
安装vmware workstation:
[root@rhel8 ~]# ls -l VMware-Workstation-Full-15.5.5-16285975.x86_64.bundle
-rw-r--r--. 1 root root 537847831 Jun 4 14:49 VMware-Workstation-Full-15.5.5-16285975.x86_64.bundle
[root@rhel8 ~]# chmod +x VMware-Workstation-Full-15.5.5-16285975.x86_64.bundle
[root@rhel8 ~]# ls -l VMware-Workstation-Full-15.5.5-16285975.x86_64.bundle
-rwxr-xr-x. 1 root root 537847831 Jun 4 14:49 VMware-Workstation-Full-15.5.5-16285975.x86_64.bundle
[root@rhel8 ~]# ./VMware-Workstation-Full-15.5.5-16285975.x86_64.bundle
Extracting VMware Installer...done.
Installing VMware Workstation 15.5.5
Configuring...
[######################################################################]
100%
Installation was successful.
点击桌面快键键:
提示报错:
查看软件包组有哪些:
安装gcc编译器和把编译后的模块加入到Linux内核中:
[root@rhel8 ~]# yum groupinstall "Development Tools"
[root@rhel8 ~]# yum -y install elfutils-libelf-devel
临时放行防火墙允许客户端连接 vmware workstation server:
[root@rhel8 ~]# firewall-cmd --add-port=443/tcp
success
[root@rhel8 ~]# firewall-cmd --add-port=902/tcp
success
安装vmware workstation:
不检查产品更新:
不加入体验计划:
使用哪个用户登录vmware workstation server:
创建虚拟机的目录:
登录vmware workstation server的端口:
远程登录vmware workstation server:
可以在远程server上创建虚拟机:
在workstation上创建虚拟机:
建议使用远程服务器上物理驱动器里面的光盘:
获得NAT网段地址:
网卡自动获得IP:
虚拟网络配置:
443端口是控制连接,902端口是图形连接的
在vmware中添加一个虚拟网络,就相当于添加了一个虚拟交换机:
vmnet1的虚拟网卡连接到vmnet1的虚拟交换机上,vmnet8同理,并且虚拟交换机都开启了DHCP服务。
就会多出来一个虚拟网卡:
虚拟网卡没有被NetworkManager管理:
设置rhel8的虚拟网卡,获得IP地址:
[root@rhel8 rhel8]# nmcli device set vmnet1 managed yes
[root@rhel8 rhel8]# nmcli device status
DEVICE TYPE STATE CONNECTION
ens256 ethernet connected dhcp
virbr0 bridge connected virbr0
vmnet1 ethernet disconnected --
vmnet2 ethernet unmanaged --
vmnet8 ethernet unmanaged --
lo loopback unmanaged --
virbr0-nic tun unmanaged --
[root@rhel8 rhel8]# nmcli device set vmnet8 managed yes
[root@rhel8 rhel8]# nmcli device status
DEVICE TYPE STATE CONNECTION
ens256 ethernet connected dhcp
virbr0 bridge connected virbr0
vmnet1 ethernet disconnected --
vmnet8 ethernet disconnected --
vmnet2 ethernet unmanaged --
lo loopback unmanaged --
virbr0-nic tun unmanaged --
两个vmnet虚拟网卡分别获得DHCP网段的IP:
[root@rhel8 rhel8]# nmcli con add con-name vmnet1-dhcp ifname vmnet1 type ethernet
Connection 'vmnet1-dhcp' (5e2896f2-d7ea-476a-bcb3-4c3ef1976622) successfully added.
[root@rhel8 rhel8]# nmcli con add con-name vmnet8-dhcp ifname vmnet8 type ethernet
Connection 'vmnet8-dhcp' (e0bac197-86a1-4d21-aa0b-2e8b6f29d3db) successfully added.
[root@rhel8 rhel8]# nmcli con up vmnet1-dhcp
Connection successfully activated (D-Bus active path:
/org/freedesktop/NetworkManager/ActiveConnection/6)
[root@rhel8 rhel8]# nmcli con up vmnet8-dhcp
Connection successfully activated (D-Bus active path:
/org/freedesktop/NetworkManager/ActiveConnection/7)
[root@rhel8 rhel8]# ifconfig vmnet1
vmnet1: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 172.16.219.1 netmask 255.255.255.0 broadcast 172.16.219.255
inet6 fe80::948f:ef85:1018:cebb prefixlen 64 scopeid 0x20<link>
ether 00:50:56:c0:00:01 txqueuelen 1000 (Ethernet)
RX packets 24 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 125 bytes 0 (0.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
[root@rhel8 rhel8]# ifconfig vmnet8
vmnet8: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 172.16.77.1 netmask 255.255.255.0 broadcast 172.16.77.255
inet6 fe80::f2bc:23f4:867:4496 prefixlen 64 scopeid 0x20<link>
ether 00:50:56:c0:00:08 txqueuelen 1000 (Ethernet)
RX packets 9 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 106 bytes 0 (0.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
虚拟机获得的IP地址:
ssh连接到虚拟机中:
虚拟机在Linux中是以进程形式存在的: