如何在Windows 10上设置默认Linux发行版

Windows 10 now allows you to install multiple Linux environments, starting with the Fall Creators Update. If you have multiple Linux environments, you can set your default and switch between them.

Windows 10现在允许您从Fall Creators Update开始安装多个Linux环境。 如果您有多个Linux环境,则可以设置默认值并在它们之间切换。

You’re free to run multiple Linux environments at once, but your default environment is used when you run a command like wsl.exe or bash.exe to launch the shell, or when you use wsl [command] or bash -c [command] to run a command from elsewhere in Windows.

您可以自由地一次运行多个Linux环境,但是当您运行诸如wsl.exebash.exe类的命令来启动Shell时,或者当您使用wsl [command]bash -c [command] wsl [command]时,将使用默认环境。 bash -c [command]从Windows的其他位置运行命令。

如何设置默认Linux发行版 (How to Set Your Default Linux Distribution)

The wslconfig.exe command lets you manage the Linux distributions running via the Windows Subsystem for Linux, or WSL.

wslconfig.exe命令使您可以管理通过Windows Subsystem for Linux或WSL运行Linux发行版。

To run it, you need to open either a Command Prompt or PowerShell window. To open a Command Prompt window, open the Start menu, type “cmd”, and then click the “Command Prompt” shortcut. To open a PowerShell window, right-click your Start button (or press Windows+X), and then select the “Windows PowerShell” command.

要运行它,您需要打开命令提示符或PowerShell窗口。 要打开命令提示符窗口,请打开“开始”菜单,键入“ cmd”,然后单击“命令提示符”快捷方式。 要打开PowerShell窗口,请右键单击“开始”按钮(或按Windows + X),然后选择“ Windows PowerShell”命令。

To view your installed Linux distributions, type the following command and hit Enter:

要查看已安装Linux发行版,请键入以下命令,然后按Enter:

wslconfig /l

The Linux distribution ending with “(Default)” is your default Linux distribution.

以“(默认)”结尾Linux发行版是您的默认Linux发行版。

If you don’t see an installed Linux distribution in this list, you’ll first need to launch it. Wait for the “Installing, this may take a few minutes…” process to complete. When it’s done, the Linux distribution will appear in this list.

如果在此列表中没有看到已安装Linux发行版,则首先需要启动它。 等待“安装,这可能需要几分钟……”过程完成。 完成后,Linux发行版将出现在此列表中。

To set your default Linux distribution, run the following command, where Name is the name of the Linux distribution:

要设置默认Linux发行版,请运行以下命令,其中Name是Linux发行版的名称:

wslconfig /setdefault Name

For example, to set Ubuntu as your default Linux distribution, run the following command:

例如,要将Ubuntu设置为默认Linux发行版,请运行以下命令:

wslconfig /setdefault Ubuntu

Now, when you run either the wsl or bash commands, the Linux distribution you selected opens.

现在,当您运行wslbash命令时,将打开您选择Linux发行版。

Your default Linux distribution is also used when you run individual commands with either  wsl command or bash -c command.

当您使用wsl commandbash -c command运行单个命令时,也会使用默认Linux发行版。

如何运行多个Linux发行版 (How to Run Multiple Linux Distributions)

You can run a Linux environment even if it isn’t your default. For example, you can launch the Ubuntu, openSUSE Leap, and SUSE Linux Enterprise Server shortcuts from your Start menu and you’ll have all three separate environments running at the same time.

即使不是默认环境,您也可以运行Linux环境。 例如,您可以从“开始”菜单中启动Ubuntu,openSUSE Leap和SUSE Linux Enterprise Server快捷方式,并且您将同时运行所有三个单独的环境。

To launch a Linux distribution from the command line or via a shortcut, just use its command. The command you need is displayed on the Linux distribution’s page in the Microsoft Store. Here are the commands you’ll need to  launch the three initial three Linux distributions:

要从命令行或通过快捷方式启动Linux发行版,只需使用其命令即可。 所需的命令显示在Microsoft StoreLinux发行版页面上。 这是启动三个最初的三个Linux发行版所需的命令:

  • Ubuntu: ubuntu

    Ubuntu的: ubuntu

  • openSUSE Leap 42: opensuse-42

    openSUSE飞跃42: opensuse-42

  • SUSE Linux Enterprise Server 12: sles-12

    SUSE Linux Enterprise Server 12: sles-12

For example, even if Ubuntu is your default environment, you can still launch openSUSE from anywhere by running the opensuse-42 command.

例如,即使Ubuntu是您的默认环境,您仍然可以通过运行opensuse-42命令从任何地方启动openSUSE。

These commands also work with the same -c switch you can use with the bash.exe command. Just use the below command structure, where “distro-command” is the same command you use to launch the Linux distribution and “command” is the Linux command you want to run.

这些命令还可以与可以与bash.exe命令一起使用的-c开关一起使用。 只需使用以下命令结构,其中“ distro-command”是用于启动Linux发行版的命令,而“ command”是您要运行Linux命令。

distro-command -c command

In other words, even if openSUSE Leap is your default Linux distribution, you can still run a command on Ubuntu from a command-line environment or script just by running ubuntu -c command .

换句话说,即使openSUSE Leap是您的默认Linux发行版,您仍然可以仅通过运行ubuntu -c command环境或脚本在ubuntu -c command运行ubuntu -c command

For example, to run the apt-get moo command that shows an Easter egg on Ubuntu, you’d run the following command:

例如,要在Ubuntu上运行显示复活节彩蛋的apt-get moo命令,请运行以下命令:

ubuntu -c apt-get moo

翻译自: https://www.howtogeek.com/344688/how-to-set-your-default-linux-distribution-on-windows-10/

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/279502.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

mysql全备份+增量备份笔记总结

备份基础知识 冷备(cold backup):需要关mysql服务,读写请求均不允许状态下进行; 温备(warm backup): 服务在线,但仅支持读请求,不允许写请求; 热备…

pjax学习

PJAX 介绍 红薯 发布于 2012/04/11 22:06阅读 61K收藏 116评论 11jQuery.Pjax kissy开发四年只会写业务代码,分布式高并发都不会还做程序员?->>> 介绍 pushState是一个可以操作history的api,该api的介绍和使用请见这里&#xff1a…

SQL Server 2000详细安装过程及配置

说明:这篇文章是几年前我发布在网易博客当中的原创文章,但由于网易博客现在要停止运营了,所以我就把这篇文章搬了过来,虽然现如今SQL Server 2000软件早已经过时了,但仍然有一部分人在使用它,尤其是某些高校…

移动应用ios和网页应用_如何在iOS上一次移动多个应用

移动应用ios和网页应用Apple doesn’t really believe in detailed instruction manuals, so some handy tricks slip through the cracks. One such trick we’ve recently discovered is that you can move multiple app icons at once on iOS. Here’s how. Apple并不真正相…

如何将内核静态库编译连接到驱动程序中去【转】

转自:http://blog.csdn.net/ganjianfeng2003/article/details/8089551 如何将内核静态库编译连接到驱动程序中去 2010-12-07 08:27 331人阅读 评论(1) 收藏 举报 http://blog.chinaunix.net/u2/61663/showart_2404744.html 刚上邮箱的时候发现一位网友向我询问这个问…

2018-2019 20165226 Exp9 Web安全基础

2018-2019 20165226 Exp9 Web安全基础 目录 一、实验内容说明及基础问题回答 二、实验过程 Webgoat准备XSS攻击 ① Phishing with XSS 跨站脚本钓鱼攻击② Stored XSS Attacks 存储型XSS攻击③ Reflected XSS Attacks 反射型XSS攻击 CSRF攻击 ① Cross Site Request Forgery(CS…

用 git 同步 Colab 与 Gitlab、Github 之间的文件

Colab 是谷歌提供的免费 Jupyter 服务,可使用 GPU。但由于每次的 VM (虚拟机)登出后所有文件都会连同VM被毁掉。如何将一个项目里的程序或数据同步到 Colab则往往比较麻烦。尽管谷歌盘也可以挂到 Colab 里用&#xff0…

keep-alive使用_如何使用Google Keep进行无忧笔记

keep-alive使用There are a lot of note-taking apps out there. Google Keep may not be as powerful as services like Evernote, but its value is in its simplicity. Let’s talk about how to make the most of it. 那里有很多笔记应用程序。 Google Keep可能不如Evernot…

ZedGraph在项目中的应用

ZedGraph在项目中的应用将数据库数据提取出来,显示成曲线图(饼状、柱状或立体图)是项目中最常见的需求。 网上搜索到的解决方法,大多归为两类,一种是利用ActiveX组件,另一种是使用.net框架自带的画图的类。…

TCP/IP:IP多播选路

本节主要讨论多播选路,是在整个互联网上的多播,我们将讨论mrouted程序的执行,该程序计算多播路由表,以及再网络之间转发多播数据包的内核函数。 多播输出处理 这个和IGMP的输出处理类似,主要要注意有环回的多播输出和没…

Leetcode#832. Flipping an Image(翻转图像)

题目描述 给定一个二进制矩阵 A,我们想先水平翻转图像,然后反转图像并返回结果。 水平翻转图片就是将图片的每一行都进行翻转,即逆序。例如,水平翻转 [1, 1, 0] 的结果是 [0, 1, 1]。 反转图片的意思是图片中的 0 全部被 1 替换&a…

数据安全 数据销毁_如何安全销毁敏感数据CD / DVD?

数据安全 数据销毁You have a pile of DVDs with sensitive information on them and you need to safely and effectively dispose of them so no data recovery is possible. What’s the most safe and efficient way to get the job done? 您有一堆DVD,上面有敏…

cannot find -lunwind-x86_64

错误代码:; }) libtool: install: /usr/bin/install -c .libs/libunwind.lai /usr/local/lib/libunwind.la libtool: install: warning: relinking libunwind-setjmp.la libtool: install: (cd /down/libunwind-1.0/src; /bin/sh /down/libunwind-1.0/libtool --…

动态切换父元素隐藏和显示里面的子元素的动画会再一次执行吗?

代码&#xff1a;完整代码:<!DOCTYPE html> <html> <head> <meta charset"UTF-8"> <title></title> <style type"text/css"> *{ margin: 0; padding: 0; } .box{ background-color: #00B83F; } .flag{ position…

MAD huashi

name1 input("请输入一个名字") name2 input("请输入一个名词") name3 input("请输入一个形容词") name4 input("请输入一个名字") name5 input("请输入一个名字") name6 input("请输入一个长辈名字") name…

如何使用QuickConnect远程访问Synology NAS

Your Synology NAS includes a QuickConnect feature that lets you access its DiskStation Manager interface remotely. Here’s how to set it up. Synology NAS包含快速连接功能&#xff0c;可让您远程访问其DiskStation Manager界面。 设置方法如下。 You were likely gr…

深入MySQL存储引擎分析锁和排序的原理

几个问题 为什么不建议使用订单号作为主键?为什么要在需要排序的字段上加索引?for update 的记录不存在会导致锁住全表?redolog 和 binlog 有什么区别?MySQL 如何回滚一条 sql ?char(50) 和 varchar(50) 效果是一样的么?索引知识回顾 对于 MySQL 数据库而言,数据是存储在…

网络编程介绍

1. 目标:编写一个C/S架构的软件 C/S: Client--------基于网络----------Server B/S: Browser-------基于网络----------Server2. 服务端需要遵循的原则: 1. 服务端与客户端都需要有唯一的地址,但是服务端的地址必须固定/绑定 2. 对外一直提供服务,稳定运行 3. 服…

[Web开发] MySpace 发布开发接口

2007年风头最盛的Web 2.0公司应该就是Facebook &#xff0c;其一炮走红的绝招就是它的开发平台。 开发者可以为Facebook 加入各种插件&#xff0c;丰富Facebook 。为了对抗 Facebook &#xff0c; 社交网站的老大Myspace 也推出了自己开发平台 http://developer.myspace.com/c…

css段落缩进_如何缩进Google文档中的段落

css段落缩进Indenting paragraphs in Google Docs requires access to the ruler, which you’ll only find in the full web version. The ruler is not present in the mobile apps. 在Google文档中缩进段落需要访问标尺&#xff0c;而标尺只能在完整的网络版本中找到。 标尺…