码迷,mamicode.com
首页 > Windows程序 > 详细

WSL安装流程 Windows下的linux

时间:2021-02-15 11:48:23      阅读:0      评论:0      收藏:0      [点我收藏+]

标签:default   napt   root   int   ctr   bind   most   bash   mic   

1.开启对应Windows功能(适用于linux的Windows子系统)

技术图片

2.微软商店对应下载 Windows terminal 、 ubantu

技术图片

3.设置 Windows terminal

技术图片

ubantu:把下面这个加到/root/.bashrc
#Fix mkdir command has wrong permissions
if grep -q Microsoft /proc/version; then
  if [ "$(umask)" == ‘0000‘ ]; then
    umask 0022
  fi
fi
Windows terminal: 可将以下提供的配置文件直接复用到设置里 以后打开Windows terminal默认打开 ubantu
// This file was initially generated by Windows Terminal 1.3.2651.0
// It should still be usable in newer versions, but newer versions might have additional
// settings, help text, or changes that you will not see unless you clear this file
// and let us generate a new one for you.
// To view the default settings, hold "alt" while clicking on the "Settings" button.
// For documentation on these settings, see: https://aka.ms/terminal-documentation
{
    "$schema": "https://aka.ms/terminal-profiles-schema",
    "defaultProfile": "{2c4de342-38b7-51cf-b940-2309a097f518}",
    "theme": "dark",
    "useTabSwitcher": false,
    "tabWidthMode": "equal",
    "confirmCloseAllTabs": true,
    "launchMode": "maximized",
    "showTabsInTitlebar": true,
    "snapToGridOnResize": false,

    // You can add more global application settings here.
    // To learn more about global settings, visit https://aka.ms/terminal-global-settings
    // If enabled, selections are automatically copied to your clipboard.
    "copyOnSelect": false,
    // If enabled, formatted data is also copied to your clipboard
    "copyFormatting": false,
    // A profile specifies a command to execute paired with information about how it should look and feel.
    // Each one of them will appear in the ‘New Tab‘ dropdown,
    //   and can be invoked from the commandline with `wt.exe -p xxx`
    // To learn more about profiles, visit https://aka.ms/terminal-profile-settings
    "profiles": {
        "defaults": {
            // Put settings here that you want to apply to all profiles.
        },
        "list": [
            {
                // Make changes here to the powershell.exe profile.
                "guid": "{61c54bbd-c2c6-5271-96e7-009a87ff44bf}",
                "name": "Windows PowerShell",
                "commandline": "powershell.exe",
                "hidden": false
            },
            {
                // Make changes here to the cmd.exe profile.
                "guid": "{0caa0dad-35be-5f56-a8ff-afceeeaa6101}",
                "name": "命令提示符",
                "commandline": "cmd.exe",
                "hidden": false
            },
            {
                "guid": "{2c4de342-38b7-51cf-b940-2309a097f518}",
                "hidden": false,
	// "backgroundImageAlignment": "center" ,
                "name": "Ubuntu",
                "source": "Windows.Terminal.Wsl",
                "startingDirectory": "\\\\wsl$\\Ubuntu\\home\\renketong",
                "acrylicOpacity": 0.7,
                "colorScheme": "Campbell",
                //"cursorColor": "#000000",
                "fontFace": "Cascadia Code PL",
                "fontSize": 12,
                "useAcrylic": true,
                "cursorShape": "vintage",
                "antialiasingMode": "cleartype",
                "backgroundImage": "C:\\Users\\hhh\\Pictures\\Saved Pictures\\xbox.jpg",
                "backgroundImageOpacity": 0.65,
                "historySize": 1000000000
            },
            {
                "guid": "{b453ae62-4e3d-5e58-b989-0a998ec441b8}",
                "hidden": true,
                "name": "Azure Cloud Shell",
                "source": "Windows.Terminal.Azure"
            }
        ]
    },
    // Add custom color schemes to this array.
    // To learn more about color schemes, visit https://aka.ms/terminal-color-schemes
    "schemes": [
        {
            "name": "Frost",
            "background": "#FFFFFF",
            "black": "#3C5712",
            "blue": "#17b2ff",
            "brightBlack": "#749B36",
            "brightBlue": "#27B2F6",
            "brightCyan": "#13A8C0",
            "brightGreen": "#89AF50",
            "brightPurple": "#F2A20A",
            "brightRed": "#F49B36",
            "brightWhite": "#741274",
            "brightYellow": "#991070",
            "cyan": "#3C96A6",
            "foreground": "#000000",
            "green": "#6AAE08",
            "purple": "#991070",
            "red": "#8D0C0C",
            "white": "#6E386E",
            "yellow": "#991070"
        },
        {
            "name": "Raspberry",
            "background": "#3C0315",
            "black": "#282A2E",
            "blue": "#0170C5",
            "brightBlack": "#676E7A",
            "brightBlue": "#80c8ff",
            "brightCyan": "#8ABEB7",
            "brightGreen": "#B5D680",
            "brightPurple": "#AC79BB",
            "brightRed": "#BD6D85",
            "brightWhite": "#FFFFFD",
            "brightYellow": "#FFFD76",
            "cyan": "#3F8D83",
            "foreground": "#FFFFFD",
            "green": "#76AB23",
            "purple": "#7D498F",
            "red": "#BD0940",
            "white": "#FFFFFD",
            "yellow": "#E0DE48"
        },
        {
            "name": "Campbell",
            "cursorColor": "#FFFFFF",
            "selectionBackground": "#FFFFFF",
            "background": "#0C0C0C",
            "foreground": "#CCCCCC",
            "black": "#0C0C0C",
            "blue": "#0037DA",
            "cyan": "#3A96DD",
            "green": "#13A10E",
            "purple": "#881798",
            "red": "#C50F1F",
            "white": "#CCCCCC",
            "yellow": "#C19C00",
            "brightBlack": "#767676",
            "brightBlue": "#3B78FF",
            "brightCyan": "#61D6D6",
            "brightGreen": "#16C60C",
            "brightPurple": "#B4009E",
            "brightRed": "#E74856",
            "brightWhite": "#F2F2F2",
            "brightYellow": "#F9F1A5"
        },
        {
            "name": "Retro",
            "background": "#000000",
            "black": "#00ff00",
            "blue": "#00ff00",
            "brightBlack": "#00ff00",
            "brightBlue": "#00ff00",
            "brightCyan": "#00ff00",
            "brightGreen": "#00ff00",
            "brightPurple": "#00ff00",
            "brightRed": "#00ff00",
            "brightWhite": "#00ff00",
            "brightYellow": "#00ff00",
            "cyan": "#00ff00",
            "foreground": "#00ff00",
            "green": "#00ff00",
            "purple": "#00ff00",
            "red": "#00ff00",
            "white": "#00ff00",
            "yellow": "#00ff00"
        }
    ],
    // Add custom actions and keybindings to this array.
    // To unbind a key combination from your defaults.json, set the command to "unbound".
    // To learn more about actions and keybindings, visit https://aka.ms/terminal-keybindings
    "actions": [
        // Copy and paste are bound to Ctrl+Shift+C and Ctrl+Shift+V in your defaults.json.
        // These two lines additionally bind them to Ctrl+C and Ctrl+V.
        // To learn more about selection, visit https://aka.ms/terminal-selection
        // {
        //     "command": {
        //         "action": "copy",
        //         "singleLine": false
        //     },
        //     "keys": "ctrl+c"
        // },
        // {
        //     "command": "paste",
        //     "keys": "ctrl+v"
        // },
        // Press Ctrl+Shift+F to open the search box
        {
            "command": "find",
            "keys": "ctrl+shift+f"
        },
        {
            "command": "nextTab",
            "keys": "ctrl+tab"
        },
        {
            "command": "prevTab",
            "keys": "ctrl+shift+tab"
        },
        // Press Alt+Shift+D to open a new pane.
        // - "split": "auto" makes this pane open in the direction that provides the most surface area.
        // - "splitMode": "duplicate" makes the new pane use the focused pane‘s profile.
        // To learn more about panes, visit https://aka.ms/terminal-panes
        {
            "command": {
                "action": "splitPane",
                "split": "auto",
                "splitMode": "duplicate"
            },
            "keys": "alt+shift+d"
        }
    ]
}

WSL安装流程 Windows下的linux

标签:default   napt   root   int   ctr   bind   most   bash   mic   

原文地址:https://www.cnblogs.com/x602/p/14395745.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!