Loading [MathJax]/jax/output/CommonHTML/config.js
前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >专栏 >WIN10下创建Ubuntu18.04子系统及安装图形界面

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

原创
作者头像
好派笔记
修改于 2021-09-17 09:00:34
修改于 2021-09-17 09:00:34
3.1K0
举报
文章被收录于专栏:好派笔记好派笔记
一.开启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 删除。

评论
登录后参与评论
暂无评论
推荐阅读
编辑精选文章
换一批
hdu 2074 堆放篮 好开心图纸标题
Time Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 12160 Accepted Submission(s): 3136
全栈程序员站长
2022/07/18
1710
九度Online Judge 题目1432:叠筐 解答
九度Online Judge 题目1432:叠筐 解答 提交网址: http://ac.jobdu.com/problem.php?pid=1432 内存限制:128 兆       时间限制:1
Enjoy233
2019/03/05
6610
杭电OJ2070-2079
Your objective for this question is to develop a program which will generate a fibbonacci number.The fibbonacci function is defined as such: f(0) = 0 f(1) = 1 f(n) = f(n-1) + f(n-2) Your program should be able to handle values of n in the range 0 to 50.
EmoryHuang
2022/09/26
2550
杭电OJ2070-2079
HDOJ 2100 Lovekey
Problem Description XYZ-26进制数是一个每位都是大写字母的数字。 A、B、C、…、X、Y、Z 分别依次代表一个0 ~ 25 的数字,一个 n 位的26进制数转化成是10进制的规则如下 A0A1A2A3…An-1 的每一位代表的数字为a0a1a2a3…an-1 ,则该XYZ-26进制数的10进制值就为
谙忆
2021/01/20
2760
HDOJ(HDU) 1708 Fibonacci String
Problem Description After little Jim learned Fibonacci Number in the class , he was very interest in it. Now he is thinking about a new thing – Fibonacci String .
谙忆
2021/01/21
2240
HDOJ 2030 汉字统计
Output 对于每一段文本,输出其中的汉字的个数,每个测试实例的输出占一行。
谙忆
2021/01/20
7250
HDOJ(HDU) 2135 Rolling table
Problem Description After the 32nd ACM/ICPC regional contest, Wiskey is beginning to prepare for CET-6. He has an English words table and read it every morning. One day, Wiskey’s chum wants to play a joke on him. He rolling the table, and tell Wiskey how many time he rotated. Rotate 90 degrees clockwise or count-clockwise each time. The table has n*n grids. Your task is tell Wiskey the final status of the table.
谙忆
2021/01/21
2120
HDOJ 2000 ASCII码排序
Problem Description 输入三个字符后,按各字符的ASCII码从小到大的顺序输出这三个字符。
谙忆
2021/01/20
5690
HDOJ/HDU 1015 Safecracker(深搜)
Problem Description === Op tech briefing, 2002/11/02 06:42 CST === “The item is locked in a Klein safe behind a painting in the second-floor library. Klein safes are extremely rare; most of them, along with Klein and his factory, were destroyed in World War II. Fortunately old Brumbaugh from research knew Klein’s secrets and wrote them down before he died. A Klein safe has two distinguishing features: a combination lock that uses letters instead of numbers, and an engraved quotation on the door. A Klein quotation always contains between five and twelve distinct uppercase letters, usually at the beginning of sentences, and mentions one or more numbers. Five of the uppercase letters form the combination that opens the safe. By combining the digits from all the numbers in the appropriate way you get a numeric target. (The details of constructing the target number are classified.) To find the combination you must select five letters v, w, x, y, and z that satisfy the following equation, where each letter is replaced by its ordinal position in the alphabet (A=1, B=2, …, Z=26). The combination is then vwxyz. If there is more than one solution then the combination is the one that is lexicographically greatest, i.e., the one that would appear last in a dictionary.”
谙忆
2021/01/21
3730
HDOJ 1266 Reverse Number(数字反向输出题)
Problem Description Welcome to 2006’4 computer college programming contest!
谙忆
2021/01/21
4020
HDOJ/HDU 1015 Safecracker(枚举、暴力)
Problem Description === Op tech briefing, 2002/11/02 06:42 CST === “The item is locked in a Klein safe behind a painting in the second-floor library. Klein safes are extremely rare; most of them, along with Klein and his factory, were destroyed in World War II. Fortunately old Brumbaugh from research knew Klein’s secrets and wrote them down before he died. A Klein safe has two distinguishing features: a combination lock that uses letters instead of numbers, and an engraved quotation on the door. A Klein quotation always contains between five and twelve distinct uppercase letters, usually at the beginning of sentences, and mentions one or more numbers. Five of the uppercase letters form the combination that opens the safe. By combining the digits from all the numbers in the appropriate way you get a numeric target. (The details of constructing the target number are classified.) To find the combination you must select five letters v, w, x, y, and z that satisfy the following equation, where each letter is replaced by its ordinal position in the alphabet (A=1, B=2, …, Z=26). The combination is then vwxyz. If there is more than one solution then the combination is the one that is lexicographically greatest, i.e., the one that would appear last in a dictionary.”
谙忆
2021/01/21
3930
HDOJ 2043 密码
网上流传一句话:”常在网上飘啊,哪能不挨刀啊~”。其实要想能安安心心地上网其实也不难,学点安全知识就可以。
谙忆
2021/01/20
3730
第十一届蓝桥杯省赛JavaC组真题——详细答案对照(完整版)
该片段中从A = A + 4 所在的行到 A = A + 8 所在的行都在第一行的循环两次中。 REPEAT 6: 所在的行到 A = A + 7 所在的行都在 REPEAT 5: 循环中。 A = A + 5 实际总共的循环次数是 2 × 5 × 6 = 60 次。 请问该程序执行完毕之后,A 的值是多少? 【答案提交】 这是一道结果填空题,你只需要算出结果后提交即可。本题的结果为一个 整数,在提交答案时只填写这个整数,填写多余的内容将无法得分。
红目香薰
2022/11/29
6080
第十一届蓝桥杯省赛JavaC组真题——详细答案对照(完整版)
Java最大公共子串(动态规划)
最大公共子串长度问题就是: 求两个串的所有子串中能够匹配上的最大长度是多少。 比如:“abcdkkk” 和 “baabcdadabc”, 可以找到的最长的公共子串是"abcd",所以最大公共子串长度为4。 下面的程序是采用矩阵法进行求解的,这对串的规模不大的情况还是比较有效的解法。 请分析该解法的思路,并补全划线部分缺失的代码。 这个有点dp的意思,分别计算两个字符串每一个字符到另一个字符是否相等 若相等 则加前面字符的最大字符串 若前面字符也分别相等则他就等于a[i-1][j-1]+1 若不想
红目香薰
2022/11/29
4020
Java最大公共子串(动态规划)
HDOJ(HDU) 2137 circumgyrate the string(此题用Java-AC不过!坑)
Problem Description Give you a string, just circumgyrate. The number N means you just circumgyrate the string N times, and each time you circumgyrate the string for 45 degree anticlockwise.
谙忆
2021/01/21
3210
HDOJ(HDU) 1570 A C
Problem Description Are you excited when you see the title “AC” ? If the answer is YES , AC it ;
谙忆
2021/01/21
2560
HDOJ(HDU) 1570 A C
HDOJ 1236 排名(练耐心题)
Problem Description 今天的上机考试虽然有实时的Ranklist,但上面的排名只是根据完成的题数排序,没有考虑 每题的分值,所以并不是最后的排名。给定录取分数线,请你写程序找出最后通过分数线的 考生,并将他们的成绩按降序打印。
谙忆
2021/01/21
2040
HDOJ(HDU) 2164 Rock, Paper, or Scissors?
Problem Description Rock, Paper, Scissors is a two player game, where each player simultaneously chooses one of the three items after counting to three. The game typically lasts a pre-determined number of rounds. The player who wins the most rounds wins the game. Given the number of rounds the players will compete, it is your job to determine which player wins after those rounds have been played.
谙忆
2021/01/21
3300
HDOJ 2049 不容易系列之(4)——考新郎
Problem Description 国庆期间,省城HZ刚刚举行了一场盛大的集体婚礼,为了使婚礼进行的丰富一些,司仪临时想出了有一个有意思的节目,叫做”考新郎”,具体的操作是这样的:
谙忆
2021/01/20
4290
第十三届蓝桥杯省赛JavaC组真题——详细答案对照(完整版)
话说真的对于大专生来说已经是非常难的了呢,能拿到省一的基本上都是万里挑一的孩子呢。
红目香薰
2023/02/10
8210
第十三届蓝桥杯省赛JavaC组真题——详细答案对照(完整版)
相关推荐
hdu 2074 堆放篮 好开心图纸标题
更多 >
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档