vmware虚拟机安装Ubuntu全过程

 

虚拟机软件:vmware workstation

ubantu系统镜像: 官网 https://ubuntu.com/download/desktop

提前在d盘创建一个安装目录D:\linux\Ubuntu_pc_1

 

1、打开vmware虚拟机,点击创建新的虚拟机

 

 

2、

 

 

3、

 

 

4、

 

 

5、

 

 

6、

 

 

7、

 

 

8、

 

 

9、

 

 

10、

 

 

11、

 

 

12、

 

 

13、

 

 

14、

 

 

15、

 

 

16、

 

 

17、注意勾选启动时连接,否则无法启动

 

 

 

18、把这三项移除

 

 

19、

 

 

20、

 

 

21、

 

 

22、

 

 

23、

 

 

24、

 

 

25、

 

 

26、

 

 

27、

 

 

28、

 

 

29、

 

 

30、此时出现如下界面

 

 

31、右击虚拟机名称,弹出菜单后选择设置

 

 

32、把启动时连接前的钩去掉,然后点击确定

 

 

33、然后点击此处,选择重新启动客户机

 

 

 

 34、

 

 

35、输入安装时设置的密码,回车

 

 

36、一路x掉

 

 

37、

 

 

38、右击桌面,选择open in terminal 

 

 

39、创建root密码

xiaoxiami@ubantupc1:~/Desktop$ sudo passwd root
[sudo] password for xiaoxiami: 
New password: 
Retype new password: 
passwd: password updated successfully

 

40、切换至root用户

iaoxiami@ubantupc1:~/Desktop$ su - root
Password: 
root@ubantupc1:~# 

 

41、测试网络

oot@ubantupc1:~# ifconfig | head -n 5

Command 'ifconfig' not found, but can be installed with:

apt install net-tools

 

42、右击虚拟机名称,选择设置

 

 

43、

 

 

44、

root@ubantupc1:~# apt install net-tools 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following NEW packages will be installed:
  net-tools
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 196 kB of archives.
After this operation, 864 kB of additional disk space will be used.
Get:1 http://cn.archive.ubuntu.com/ubuntu focal/main amd64 net-tools amd64 1.60+git20180626.aebd88e-1ubuntu1 [196 kB]
Fetched 196 kB in 6s (32.7 kB/s)                                                                                                 
Selecting previously unselected package net-tools.
(Reading database ... 180241 files and directories currently installed.)
Preparing to unpack .../net-tools_1.60+git20180626.aebd88e-1ubuntu1_amd64.deb ...
Unpacking net-tools (1.60+git20180626.aebd88e-1ubuntu1) ...
Setting up net-tools (1.60+git20180626.aebd88e-1ubuntu1) ...
Processing triggers for man-db (2.9.1-1) ...
root@ubantupc1:~# ifconfig | head -n 5
ens32: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.3.29  netmask 255.255.255.0  broadcast 192.168.3.255
        inet6 fe80::f90:5d3b:be01:83d9  prefixlen 64  scopeid 0x20<link>
        ether 00:0c:29:43:a9:73  txqueuelen 1000  (Ethernet)
        RX packets 247625  bytes 334599463 (334.5 MB)

 

45、测试网络

root@ubantupc1:~# ping www.baidu.com  ## 测试外网
PING www.a.shifen.com (39.156.66.18) 56(84) bytes of data.
64 bytes from 39.156.66.18 (39.156.66.18): icmp_seq=1 ttl=51 time=13.3 ms
64 bytes from 39.156.66.18 (39.156.66.18): icmp_seq=2 ttl=51 time=13.4 ms
64 bytes from 39.156.66.18 (39.156.66.18): icmp_seq=3 ttl=51 time=13.1 ms
64 bytes from 39.156.66.18 (39.156.66.18): icmp_seq=4 ttl=51 time=13.4 ms
^C
--- www.a.shifen.com ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 6021ms
rtt min/avg/max/mdev = 13.116/13.296/13.409/0.110 ms

 

root@ubantupc1:~# ping 192.168.3.4  ## 测试本地物理机
PING 192.168.3.4 (192.168.3.4) 56(84) bytes of data.
64 bytes from 192.168.3.4: icmp_seq=1 ttl=128 time=0.179 ms
64 bytes from 192.168.3.4: icmp_seq=2 ttl=128 time=0.189 ms
64 bytes from 192.168.3.4: icmp_seq=3 ttl=128 time=0.177 ms
64 bytes from 192.168.3.4: icmp_seq=4 ttl=128 time=0.164 ms
64 bytes from 192.168.3.4: icmp_seq=5 ttl=128 time=0.187 ms
^C
--- 192.168.3.4 ping statistics ---
5 packets transmitted, 5 received, 0% packet loss, time 4103ms
rtt min/avg/max/mdev = 0.164/0.179/0.189/0.008 ms

 

C:\Users\75377>ping 192.168.3.29   ## 物理机ping 虚拟机

正在 Ping 192.168.3.29 具有 32 字节的数据:
来自 192.168.3.29 的回复: 字节=32 时间<1ms TTL=64
来自 192.168.3.29 的回复: 字节=32 时间<1ms TTL=64
来自 192.168.3.29 的回复: 字节=32 时间<1ms TTL=64
来自 192.168.3.29 的回复: 字节=32 时间<1ms TTL=64

192.168.3.29 的 Ping 统计信息:
    数据包: 已发送 = 4,已接收 = 4,丢失 = 0 (0% 丢失),
往返行程的估计时间(以毫秒为单位):
    最短 = 0ms,最长 = 0ms,平均 = 0ms

 

46、安装ssh服务

root@ubantupc1:~# apt-get install openssh-server
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following additional packages will be installed:
  ncurses-term openssh-sftp-server ssh-import-id
Suggested packages:
  molly-guard monkeysphere ssh-askpass
The following NEW packages will be installed:
  ncurses-term openssh-server openssh-sftp-server ssh-import-id
0 upgraded, 4 newly installed, 0 to remove and 0 not upgraded.
Need to get 688 kB of archives.
After this operation, 6,010 kB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 http://cn.archive.ubuntu.com/ubuntu focal/main amd64 ncurses-term all 6.2-0ubuntu2 [249 kB]
Get:2 http://cn.archive.ubuntu.com/ubuntu focal-updates/main amd64 openssh-sftp-server amd64 1:8.2p1-4ubuntu0.1 [51.5 kB]
Get:3 http://cn.archive.ubuntu.com/ubuntu focal-updates/main amd64 openssh-server amd64 1:8.2p1-4ubuntu0.1 [377 kB]              
Get:4 http://cn.archive.ubuntu.com/ubuntu focal/main amd64 ssh-import-id all 5.10-0ubuntu1 [10.0 kB]                             
Fetched 688 kB in 14s (48.4 kB/s)                                                                                                
Preconfiguring packages ...
Selecting previously unselected package ncurses-term.
(Reading database ... 180290 files and directories currently installed.)
Preparing to unpack .../ncurses-term_6.2-0ubuntu2_all.deb ...
Unpacking ncurses-term (6.2-0ubuntu2) ...
Selecting previously unselected package openssh-sftp-server.
Preparing to unpack .../openssh-sftp-server_1%3a8.2p1-4ubuntu0.1_amd64.deb ...
Unpacking openssh-sftp-server (1:8.2p1-4ubuntu0.1) ...
Selecting previously unselected package openssh-server.
Preparing to unpack .../openssh-server_1%3a8.2p1-4ubuntu0.1_amd64.deb ...
Unpacking openssh-server (1:8.2p1-4ubuntu0.1) ...
Selecting previously unselected package ssh-import-id.
Preparing to unpack .../ssh-import-id_5.10-0ubuntu1_all.deb ...
Unpacking ssh-import-id (5.10-0ubuntu1) ...
Setting up openssh-sftp-server (1:8.2p1-4ubuntu0.1) ...
Setting up openssh-server (1:8.2p1-4ubuntu0.1) ...

Creating config file /etc/ssh/sshd_config with new version
Creating SSH2 RSA key; this may take some time ...
3072 SHA256:5csmtxdqgRivQ2lVtl9dIIFhAoTde/ahVtbflkrTqbM root@ubantupc1 (RSA)
Creating SSH2 ECDSA key; this may take some time ...
256 SHA256:QSvBl91xiQwryrFI2iFwxyPn4hCy5p+2s6qJYSFEpS0 root@ubantupc1 (ECDSA)
Creating SSH2 ED25519 key; this may take some time ...
256 SHA256:9EhHVJd2x/ZKcZn637cOABoHe2net5PX8LRApkPDiOQ root@ubantupc1 (ED25519)
Created symlink /etc/systemd/system/sshd.service → /lib/systemd/system/ssh.service.
Created symlink /etc/systemd/system/multi-user.target.wants/ssh.service → /lib/systemd/system/ssh.service.
rescue-ssh.target is a disabled or a static unit, not starting it.
Setting up ssh-import-id (5.10-0ubuntu1) ...
Attempting to convert /etc/ssh/ssh_import_id
Setting up ncurses-term (6.2-0ubuntu2) ...
Processing triggers for systemd (245.4-4ubuntu3.3) ...
Processing triggers for man-db (2.9.1-1) ...
Processing triggers for ufw (0.36-6) ...

 

47、ssh登录测试

 

 

 

 

 

 完成。

 

 

posted @ 2020-12-29 17:48  小鲨鱼2018  阅读(13061)  评论(2编辑  收藏  举报