前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >WIN10下创建Ubuntu18.04子系统及安装图形界面

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

原创
作者头像
好派笔记
修改2021-09-17 17:00:34
2.9K0
修改2021-09-17 17:00:34
举报
文章被收录于专栏:好派笔记
一.开启WIN10子系统WSL

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

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

2.启用WINDOWS子系统功能

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

二、在应用商店里安装ubuntu

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

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

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

root@moonrong:~# lsb_release -a

  1. No LSB modules are available.  
  2. Distributor ID: Ubuntu  
  3. Description:    Ubuntu 18.04.1 LTS  
  4. Release:        18.04  
  5. Codename:       bionic  
  6. root@moonrong:~#

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

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. ## Major bug fix updates produced after the final release of the
  7. ## distribution.
  8. deb http://archive.ubuntu.com/ubuntu/ bionic-updates main restricted  
  9. # deb-src http://archive.ubuntu.com/ubuntu/ bionic-updates main restricted
  10. ## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
  11. ## team. Also, please note that software in universe WILL NOT receive any
  12. ## review or updates from the Ubuntu security team.
  13. deb http://archive.ubuntu.com/ubuntu/ bionic universe  
  14. # deb-src http://archive.ubuntu.com/ubuntu/ bionic universe
  15. deb http://archive.ubuntu.com/ubuntu/ bionic-updates universe  
  16. # deb-src http://archive.ubuntu.com/ubuntu/ bionic-updates universe
  17. ## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
  18. ## team, and may not be under a free licence. Please satisfy yourself as to
  19. ## your rights to use the software. Also, please note that software in
  20. ## multiverse WILL NOT receive any review or updates from the Ubuntu
  21. ## security team.
  22. deb http://archive.ubuntu.com/ubuntu/ bionic multiverse  
  23. # deb-src http://archive.ubuntu.com/ubuntu/ bionic multiverse
  24. deb http://archive.ubuntu.com/ubuntu/ bionic-updates multiverse  
  25. # deb-src http://archive.ubuntu.com/ubuntu/ bionic-updates multiverse
  26. ## N.B. software from this repository may not have been tested as
  27. ## extensively as that contained in the main release, although it includes
  28. ## newer versions of some applications which may provide useful features.
  29. ## Also, please note that software in backports WILL NOT receive any review
  30. ## or updates from the Ubuntu security team.
  31. deb http://archive.ubuntu.com/ubuntu/ bionic-backports main restricted universe multiverse  
  32. # deb-src http://archive.ubuntu.com/ubuntu/ bionic-backports main restricted universe multiverse
  33. ## Uncomment the following two lines to add software from Canonical's
  34. ## 'partner' repository.
  35. ## This software is not part of Ubuntu, but is offered by Canonical and the
  36. ## respective vendors as a service to Ubuntu users.
  37. # deb http://archive.canonical.com/ubuntu bionic partner
  38. # deb-src http://archive.canonical.com/ubuntu bionic partner
  39. deb http://security.ubuntu.com/ubuntu/ bionic-security main restricted  
  40. # deb-src http://security.ubuntu.com/ubuntu/ bionic-security main restricted
  41. deb http://security.ubuntu.com/ubuntu/ bionic-security universe  
  42. # deb-src http://security.ubuntu.com/ubuntu/ bionic-security universe
  43. deb http://security.ubuntu.com/ubuntu/ bionic-security multiverse  
  44. # deb-src http://security.ubuntu.com/ubuntu/ bionic-security multiverse
  45. 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. :%s/security.ubuntu/mirrors.aliyun/g  
  4. :%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

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

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

配置完成后点击close关闭

4.开启桌面

root@moonrong:~#compiz

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

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

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

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

net stop LxssManager

net start LxssManager

原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。

如有侵权,请联系 cloudcommunity@tencent.com 删除。

原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。

如有侵权,请联系 cloudcommunity@tencent.com 删除。

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
目录
  • 一.开启WIN10子系统WSL
  • 二、在应用商店里安装ubuntu
  • 三.进入子系统并查看当前版本信息
  • 五.安装图形界面相关软件及配置过程
  • 六.如何重启windows 10子系统(WSL)ubuntu
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档