如何在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.pswp.cn/news/279502.shtml
繁體地址,請注明出處:http://hk.pswp.cn/news/279502.shtml
英文地址,請注明出處:http://en.pswp.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;而標尺只能在完整的網絡版本中找到。 標尺…