WIN10下创建Ubuntu18.04子系统及安装图形界面

  • A+
所属分类:LINUX运维 运维基础

一.开启WIN10子系统WSL

1.设置开发人员工作模式

设置——>更新和安全——>针对开发人员——>开发人员模式

WIN10下创建Ubuntu18.04子系统及安装图形界面

2.启用WINDOWS子系统功能

控制面板——>程序——>程序和功能——>启用或关闭Windows功能——>适用于Linux的Windows子系统——>确定 (然后重启)

WIN10下创建Ubuntu18.04子系统及安装图形界面

二、在应用商店里安装ubuntu

打开微软件应用商店,搜索ubuntu,然后安装

WIN10下创建Ubuntu18.04子系统及安装图形界面
WIN10下创建Ubuntu18.04子系统及安装图形界面

安装完成后,子系统放在这里:

WIN10下创建Ubuntu18.04子系统及安装图形界面

三.进入子系统并查看当前版本信息

WIN10下创建Ubuntu18.04子系统及安装图形界面
  1. root@moonrong:~# lsb_release -a  
  2. No LSB modules are available.  
  3. Distributor ID: Ubuntu  
  4. Description:    Ubuntu 18.04.1 LTS  
  5. Release:        18.04  
  6. Codename:       bionic  
  7. root@moonrong:~#  
WIN10下创建Ubuntu18.04子系统及安装图形界面

四.修改默认源为阿里云镜像并更新

1.确认默认源并查看

  1. root@moonrong:~# cat /etc/apt/sources.list  
  2. # See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to  
  3. # newer versions of the distribution.  
  4. deb http://archive.ubuntu.com/ubuntu/ bionic main restricted  
  5. # deb-src http://archive.ubuntu.com/ubuntu/ bionic main restricted  
  6.   
  7. ## Major bug fix updates produced after the final release of the  
  8. ## distribution.  
  9. deb http://archive.ubuntu.com/ubuntu/ bionic-updates main restricted  
  10. # deb-src http://archive.ubuntu.com/ubuntu/ bionic-updates main restricted  
  11.   
  12. ## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu  
  13. ## team. Also, please note that software in universe WILL NOT receive any  
  14. ## review or updates from the Ubuntu security team.  
  15. deb http://archive.ubuntu.com/ubuntu/ bionic universe  
  16. # deb-src http://archive.ubuntu.com/ubuntu/ bionic universe  
  17. deb http://archive.ubuntu.com/ubuntu/ bionic-updates universe  
  18. # deb-src http://archive.ubuntu.com/ubuntu/ bionic-updates universe  
  19.   
  20. ## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu  
  21. ## team, and may not be under a free licence. Please satisfy yourself as to  
  22. ## your rights to use the software. Also, please note that software in  
  23. ## multiverse WILL NOT receive any review or updates from the Ubuntu  
  24. ## security team.  
  25. deb http://archive.ubuntu.com/ubuntu/ bionic multiverse  
  26. # deb-src http://archive.ubuntu.com/ubuntu/ bionic multiverse  
  27. deb http://archive.ubuntu.com/ubuntu/ bionic-updates multiverse  
  28. # deb-src http://archive.ubuntu.com/ubuntu/ bionic-updates multiverse  
  29.   
  30. ## N.B. software from this repository may not have been tested as  
  31. ## extensively as that contained in the main release, although it includes  
  32. ## newer versions of some applications which may provide useful features.  
  33. ## Also, please note that software in backports WILL NOT receive any review  
  34. ## or updates from the Ubuntu security team.  
  35. deb http://archive.ubuntu.com/ubuntu/ bionic-backports main restricted universe multiverse  
  36. # deb-src http://archive.ubuntu.com/ubuntu/ bionic-backports main restricted universe multiverse  
  37.   
  38. ## Uncomment the following two lines to add software from Canonical's  
  39. ## 'partner' repository.  
  40. ## This software is not part of Ubuntu, but is offered by Canonical and the  
  41. ## respective vendors as a service to Ubuntu users.  
  42. # deb http://archive.canonical.com/ubuntu bionic partner  
  43. # deb-src http://archive.canonical.com/ubuntu bionic partner  
  44.   
  45. deb http://security.ubuntu.com/ubuntu/ bionic-security main restricted  
  46. # deb-src http://security.ubuntu.com/ubuntu/ bionic-security main restricted  
  47. deb http://security.ubuntu.com/ubuntu/ bionic-security universe  
  48. # deb-src http://security.ubuntu.com/ubuntu/ bionic-security universe  
  49. deb http://security.ubuntu.com/ubuntu/ bionic-security multiverse  
  50. # deb-src http://security.ubuntu.com/ubuntu/ bionic-security multiverse  
  51. root@moonrong:~#  

2.修改默认源

1)备份原配置文件

  1. root@moonrong:~# cp /etc/apt/sources.list /etc/apt/sources.list.mybak20190227  
  2. root@moonrong:~#  

2)修改源为阿里云镜像

用VIM进行替换

  1. root@moonrong:~# vim /etc/apt/sources.list  
  2. root@moonrong:~#  
  3.   
  4. :%s/security.ubuntu/mirrors.aliyun/g  
  5. :%s/archive.ubuntu/mirrors.aliyun/g  

3.更新

  1. root@moonrong:~# apt update  
  2. Get:1 http://mirrors.aliyun.com/ubuntu xenial InRelease [247 kB]  
  3. Get:2 http://mirrors.aliyun.com/ubuntu xenial-updates InRelease [109 kB]  
  4. Get:3 http://mirrors.aliyun.com/ubuntu xenial-security InRelease [109 kB]  
  5. Get:4 http://mirrors.aliyun.com/ubuntu xenial/main amd64 Packages [1,201 kB]  
  6. Get:5 http://mirrors.aliyun.com/ubuntu xenial/main Translation-en [568 kB]  
  7. Get:6 http://mirrors.aliyun.com/ubuntu xenial/restricted amd64 Packages [8,344 B]  
  8. Get:7 http://mirrors.aliyun.com/ubuntu xenial/restricted Translation-en [2,908 B]  
  9. Get:8 http://mirrors.aliyun.com/ubuntu xenial/universe amd64 Packages [7,532 kB]  
  10. Get:9 http://mirrors.aliyun.com/ubuntu xenial/universe Translation-en [4,354 kB]  
  11. Get:10 http://mirrors.aliyun.com/ubuntu xenial/multiverse amd64 Packages [144 kB]  
  12. Get:11 http://mirrors.aliyun.com/ubuntu xenial/multiverse Translation-en [106 kB]  
  13. Get:12 http://mirrors.aliyun.com/ubuntu xenial-updates/main amd64 Packages [913 kB]  
  14. Get:13 http://mirrors.aliyun.com/ubuntu xenial-updates/main Translation-en [368 kB]  
  15. Get:14 http://mirrors.aliyun.com/ubuntu xenial-updates/restricted amd64 Packages [7,556 B]  
  16. Get:15 http://mirrors.aliyun.com/ubuntu xenial-updates/restricted Translation-en [2,272 B]  
  17. Get:16 http://mirrors.aliyun.com/ubuntu xenial-updates/universe amd64 Packages [732 kB]  
  18. Get:17 http://mirrors.aliyun.com/ubuntu xenial-updates/universe Translation-en [302 kB]  
  19. Get:18 http://mirrors.aliyun.com/ubuntu xenial-updates/multiverse amd64 Packages [16.6 kB]  
  20. Get:19 http://mirrors.aliyun.com/ubuntu xenial-updates/multiverse Translation-en [8,440 B]  
  21. Get:20 http://mirrors.aliyun.com/ubuntu xenial-security/main amd64 Packages [615 kB]  
  22. Get:21 http://mirrors.aliyun.com/ubuntu xenial-security/main Translation-en [254 kB]  
  23. Get:22 http://mirrors.aliyun.com/ubuntu xenial-security/restricted amd64 Packages [7,204 B]  
  24. Get:23 http://mirrors.aliyun.com/ubuntu xenial-security/restricted Translation-en [2,152 B]  
  25. Get:24 http://mirrors.aliyun.com/ubuntu xenial-security/universe amd64 Packages [425 kB]  
  26. Get:25 http://mirrors.aliyun.com/ubuntu xenial-security/universe Translation-en [171 kB]  
  27. Get:26 http://mirrors.aliyun.com/ubuntu xenial-security/multiverse amd64 Packages [5,600 B]  
  28. Get:27 http://mirrors.aliyun.com/ubuntu xenial-security/multiverse Translation-en [2,676 B]  
  29. Fetched 18.2 MB in 10s (1,802 kB/s)  
  30. Reading package lists... Done  
  31. Building dependency tree  
  32. Reading state information... Done  
  33. 208 packages can be upgraded. Run 'apt list --upgradable' to see them.  
  34. root@moonrong:~#  

五.安装图形界面相关软件及配置过程

1.安装VcSrv

下载VcSrv并在WIN10上安装

https://sourceforge.net/projects/vcxsrv/

安装完成后启动Xlaunch

WIN10下创建Ubuntu18.04子系统及安装图形界面

按上图完成设置,并一直按下一步直到出现下图界面

WIN10下创建Ubuntu18.04子系统及安装图形界面

2安装ubuntu-desktop,unity,ccsm

  1. root@moonrong:~#apt-get install ubuntu-desktop unity compizconfig-settings-manager  

3.配置ccsm

在XLaunch启动的情况下输入

  1. root@moonrong:~# export DISPLAY=localhost:0  
  2. root@moonrong:~# ccsm  
WIN10下创建Ubuntu18.04子系统及安装图形界面
WIN10下创建Ubuntu18.04子系统及安装图形界面
WIN10下创建Ubuntu18.04子系统及安装图形界面
WIN10下创建Ubuntu18.04子系统及安装图形界面

配置完成后点击close关闭

4.开启桌面

root@moonrong:~#compiz

WIN10下创建Ubuntu18.04子系统及安装图形界面

最终启动完成,WIN10下界面如上图所示。

六.如何重启windows 10子系统(WSL)ubuntu

WSL子系统是基于LxssManager服务运行的

在WIN10的CMD命令下输入下面命令完成重启

net stop LxssManager

net start LxssManager

moonrong
  • 版权声明:本站原创文章,于2019年2月28日09:56:45,由 发表,共 6627 字。
  • 版权声明: 本文由于2019年2月28日09:56:45 发表在 好派笔记,共 6627 字。

发表评论

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen: