WSL 服务自动启动

WSL 服务自动启动

参考 https://zhuanlan.zhihu.com/p/47733615

 

Windows 启用 WSL 功能支持

> Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux

 

在Windows应用商店中下载安装 Ubuntu 系统

 

 

 

echo $TERM
export TERM=xterm-256color

 

 检查域名解析服务器是否正确

~$ 
~$ sudo cat /etc/resolvconf/resolv.conf.d/base 
nameserver 223.5.5.5
nameserver 119.29.29.29
options edns0 trust-ad
search lan
~$ 
~$ sudo cat /etc/resolv.conf 
# This file was automatically generated by WSL. To stop automatic generation of this file, add the following entry to /etc/wsl.conf:
# [network]
# generateResolvConf = false

nameserver 223.5.5.5
nameserver 119.29.29.29
options edns0 trust-ad
search lan

~$ sudo cp /etc/resolvconf/resolv.conf.d/base /run/resolvconf/resolv.conf

 

Ubuntu 系统设置更新源设置为国内更新源

lsgx@DESKTOP-OS0DFSI:~$ sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak
lsgx@DESKTOP-OS0DFSI:~$ sudo cat /etc/apt/sources.list
# See https://mirrors.tuna.tsinghua.edu.cn/help/ubuntu/
# 默认注释了源码镜像以提高 apt update 速度,如有需要可自行取消注释
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic main restricted universe multiverse
deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse
deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse
deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-security main restricted universe multiverse
deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-security main restricted universe multiverse

# 预发布软件源,不建议启用
#deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse
#deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse

lsgx@DESKTOP-OS0DFSI:~$ 

 

Ubuntu 系统升级更新

lsgx@DESKTOP-OS0DFSI:~$ sudo apt-get update && sudo apt-get upgrade -y && sudo apt-get dist-upgrade -y && sudo apt-get autoremove -y

 

Ubuntu 系统安装 ssh 服务

lsgx@DESKTOP-OS0DFSI:~$ sudo apt-get install aptitude
lsgx@DESKTOP-OS0DFSI:~$ 
lsgx@DESKTOP-OS0DFSI:~$ sudo aptitude purge openssh-server openssh-sftp-server
lsgx@DESKTOP-OS0DFSI:~$ sudo aptitude install openssh-server openssh-sftp-server
lsgx@DESKTOP-OS0DFSI:~$ 
lsgx@DESKTOP-OS0DFSI:~$ sudo cat /etc/ssh/sshd_config
#       $OpenBSD: sshd_config,v 1.101 2017/03/14 07:19:07 djm Exp $

# This is the sshd server system-wide configuration file.  See
# sshd_config(5) for more information.

# Restart ssh service command : sudo service ssh --full-restart

# This sshd was compiled with PATH=/usr/bin:/bin:/usr/sbin:/sbin

# The strategy used for options in the default sshd_config shipped with
# OpenSSH is to specify options with their default value where
# possible, but leave them commented.  Uncommented options override the
# default value.

Port 2222
#AddressFamily any
ListenAddress 0.0.0.0
#ListenAddress ::

#HostKey /etc/ssh/ssh_host_rsa_key
#HostKey /etc/ssh/ssh_host_ecdsa_key
#HostKey /etc/ssh/ssh_host_ed25519_key

# Ciphers and keying
#RekeyLimit default none

# Logging
#SyslogFacility AUTH
#LogLevel INFO

# Authentication:

#LoginGraceTime 2m
PermitRootLogin no
#StrictModes yes
#MaxAuthTries 6
#MaxSessions 10

#PubkeyAuthentication yes

# Expect .ssh/authorized_keys2 to be disregarded by default in future.
#AuthorizedKeysFile     .ssh/authorized_keys .ssh/authorized_keys2

#AuthorizedPrincipalsFile none

#AuthorizedKeysCommand none
#AuthorizedKeysCommandUser nobody

# For this to work you will also need host keys in /etc/ssh/ssh_known_hosts
#HostbasedAuthentication no
# Change to yes if you don't trust ~/.ssh/known_hosts for
# HostbasedAuthentication
#IgnoreUserKnownHosts no
# Don't read the user's ~/.rhosts and ~/.shosts files
#IgnoreRhosts yes

# To disable tunneled clear text passwords, change to no here!
PasswordAuthentication yes
#PermitEmptyPasswords no

# Change to yes to enable challenge-response passwords (beware issues with
# some PAM modules and threads)
ChallengeResponseAuthentication no

AllowUsers lsgx

# Kerberos options
#KerberosAuthentication no
#KerberosOrLocalPasswd yes
#KerberosTicketCleanup yes
#KerberosGetAFSToken no

# GSSAPI options
#GSSAPIAuthentication no
#GSSAPICleanupCredentials yes
#GSSAPIStrictAcceptorCheck yes
#GSSAPIKeyExchange no

# Set this to 'yes' to enable PAM authentication, account processing,
# and session processing. If this is enabled, PAM authentication will
# be allowed through the ChallengeResponseAuthentication and
# PasswordAuthentication.  Depending on your PAM configuration,
# PAM authentication via ChallengeResponseAuthentication may bypass
# the setting of "PermitRootLogin without-password".
# If you just want the PAM account and session checks to run without
# PAM authentication, then enable this but set PasswordAuthentication
# and ChallengeResponseAuthentication to 'no'.
UsePAM yes

#AllowAgentForwarding yes
#AllowTcpForwarding yes
#GatewayPorts no
X11Forwarding yes
#X11DisplayOffset 10
#X11UseLocalhost yes
#PermitTTY yes
PrintMotd no
#PrintLastLog yes
#TCPKeepAlive yes
#UseLogin no
#PermitUserEnvironment no
#Compression delayed
#ClientAliveInterval 0
#ClientAliveCountMax 3
#UseDNS no
#PidFile /var/run/sshd.pid
#MaxStartups 10:30:100
#PermitTunnel no
#ChrootDirectory none
#VersionAddendum none

# no default banner path
#Banner none

# Allow client to pass locale environment variables
AcceptEnv LANG LC_*

# override default of no subsystems
Subsystem       sftp    /usr/lib/openssh/sftp-server

# Example of overriding settings on a per-user basis
#Match User anoncvs
#       X11Forwarding no
#       AllowTcpForwarding no
#       PermitTTY no
#       ForceCommand cvs server
lsgx@DESKTOP-OS0DFSI:~$ 
lsgx@DESKTOP-OS0DFSI:~$ sudo service ssh --full-restart
lsgx@DESKTOP-OS0DFSI:~$ 

 

Windows 防火墙中开放 2222 端口拨入

 

 

Ubuntu 系统添加启动脚本文件 /etc/init.wsl

lsgx@DESKTOP-OS0DFSI:~$ sudo aptitude install supervisor
lsgx@DESKTOP-OS0DFSI:~$ 
lsgx@DESKTOP-OS0DFSI:~$ sudo cat /etc/init.wsl
#! /bin/sh
# Filename: /etc/init.wsl
# Usage: sudo /etc/init.wsl [start|stop|restart]

# Warn: only support wsl env
#cd /bin && mv -f systemd-sysusers{,.org} && ln -s echo systemd-sysusers && cd -
/usr/bin/mkdir -p /run/resolvconf && /usr/bin/cp /etc/resolvconf/resolv.conf.d/base /run/resolvconf/resolv.conf
/etc/init.d/cron $1 /etc/init.d/ssh $1 /etc/init.d/supervisor $1 lsgx@DESKTOP-OS0DFSI:~$
lsgx@DESKTOP-OS0DFSI:~$ cat /etc/wsl.conf 

[boot]
systemd=true

[interop]
enabled=false
appendWindowsPath=false

[network]
generateResolvConf=false
lsgx@DESKTOP-OS0DFSI:~$ sudo chmod +x /etc/init.wsl lsgx@DESKTOP-OS0DFSI:~$ lsgx@DESKTOP-OS0DFSI:~$ sudo cat /etc/sudoers # # This file MUST be edited with the 'visudo' command as root. # # Please consider adding local content in /etc/sudoers.d/ instead of # directly modifying this file. # # See the man page for details on how to write a sudoers file. # Defaults env_reset Defaults mail_badpass Defaults secure_path="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin" # Host alias specification # User alias specification # Cmnd alias specification # User privilege specification root ALL=(ALL:ALL) ALL # Members of the admin group may gain root privileges %admin ALL=(ALL) ALL # Allow members of group sudo to execute any command %sudo ALL=(ALL:ALL) ALL %sudo ALL=NOPASSWD: /etc/init.wsl # See sudoers(5) for more information on "#include" directives: #includedir /etc/sudoers.d lsgx@DESKTOP-OS0DFSI:~$

 

Windows 中添加自动启动的脚本 startubuntu.vbs 。

 

a. 打开当前用户默认自启动加载文件夹,在 Windows 中,开始-运行,输入:

shell:startup

 

b. 在当前用户默认自启动加载文件夹中,添加要加载的VBS脚本文件 startubuntu.vbs 。

Set ws = WScript.CreateObject("WScript.Shell")
ws.run "ubuntu run sudo /etc/init.wsl start", vbhide

 

重启 Windows 系统,验证WSL服务是否自动启动。

 

查看 Ubuntu 系统启动的服务列表

lsgx@DESKTOP-OS0DFSI:~$ sudo systemctl list-unit-files | grep enable
lsgx@DESKTOP-OS0DFSI:~$
lsgx@DESKTOP-OS0DFSI:~$ sudo service --status-all [ - ] acpid [ - ] apparmor [ ? ] apport [ - ] atd [ - ] console-setup.sh [ + ] cron [ ? ] cryptdisks [ ? ] cryptdisks-early [ - ] dbus [ - ] ebtables [ ? ] hwclock.sh [ + ] irqbalance [ + ] iscsid [ - ] keyboard-setup.sh [ - ] kmod [ - ] lvm2 [ + ] lvm2-lvmetad [ + ] lvm2-lvmpolld [ - ] lxcfs [ - ] lxd [ - ] mdadm [ - ] mdadm-waitidle [ + ] open-iscsi [ - ] open-vm-tools [ ? ] plymouth [ ? ] plymouth-log [ - ] procps [ - ] rsync [ - ] rsyslog [ - ] screen-cleanup [ + ] ssh [ + ] supervisor [ - ] udev [ - ] ufw [ - ] unattended-upgrades [ - ] uuidd [ - ] x11-common lsgx@DESKTOP-OS0DFSI:~$

 

开发环境软件安装

$ sudo aptitude install tree
$ sudo aptitude install curl
$ sudo aptitude install wget $ sudo aptitude install htop
$ sudo aptitude install bash bash-completion $ sudo aptitude install xterm $ sudo aptitude install tmux $ sudo aptitude install p7zip-full $ sudo aptitude install dmidecode $ sudo aptitude install pciutils $ sudo aptitude install psmisc $ sudo aptitude install v86d
$ sudo aptitude install hwinfo $ sudo aptitude install lshw $ sudo aptitude install smartmontools $ sudo aptitude install build-essential $ sudo aptitude install gdb gdb-doc cgdb $ sudo aptitude install perl perl-doc $ sudo aptitude install guile-2.2 guile-2.2-libs guile-2.2-doc
$ sudo aptitude install chezscheme $ sudo aptitude install expect $ sudo aptitude install autoconf automake $ sudo aptitude install libtool libtool-bin libtool-doc $ sudo aptitude install cmake cmake-curses-gui cmake-doc $ sudo aptitude install git git-doc $ sudo aptitude install subversion subversion-tools $ sudo aptitude install fakeroot $ sudo aptitude install valgrind $ sudo aptitude install bison $ sudo aptitude install flex flex-doc $ sudo aptitude install swig $ sudo aptitude install libncurses5-dev $ sudo aptitude install libssl-dev $ sudo aptitude install libiconv-hook-dev $ sudo aptitude install dpkg-dev $ sudo aptitude install kernel-package $ sudo aptitude install linux-headers-`uname -r` $ sudo aptitude install locales language-selector-common $ sudo aptitude install language-pack-en language-pack-en-base $ sudo aptitude install language-pack-zh-hans language-pack-zh-hans-base $

 

lsgx@DESKTOP-OS0DFSI:~$ cat /var/lib/locales/supported.d/local 
en_US.UTF-8 UTF-8
zh_CN.UTF-8 UTF-8
zh_SG.UTF-8 UTF-8
lsgx@DESKTOP-OS0DFSI:~$ 
lsgx@DESKTOP-OS0DFSI:~$ 
lsgx@DESKTOP-OS0DFSI:~$ cat /etc/default/locale
#  File generated by update-locale
LANG="en_US.UTF-8"
LANGUAGE="en_US:en"
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_PAPER="en_US.UTF-8"
LC_NAME="en_US.UTF-8"
LC_ADDRESS="en_US.UTF-8"
LC_TELEPHONE="en_US.UTF-8"
LC_MEASUREMENT="en_US.UTF-8"
LC_IDENTIFICATION="en_US.UTF-8"
lsgx@DESKTOP-OS0DFSI:~$ 
lsgx@DESKTOP-OS0DFSI:~$ 

 

lsgx@DESKTOP-OS0DFSI:~$ cat ~/.vimrc 
" An example for a vimrc file.
"
" Maintainer:   Bram Moolenaar <Bram@vim.org>
" Last change:  2001 Jul 18
"
" To use it, copy it to
"     for Unix and OS/2:  ~/.vimrc
"         for Amiga:  s:.vimrc
"  for MS-DOS and Win32:  $VIM\_vimrc
"       for OpenVMS:  sys$login:.vimrc

"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" 一般设定
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" 设定默认解码
set guifont=-misc-simsun-medium-r-normal-*-*-120-*-*-c-*-iso10646-1
set bsdir=buffer
set enc=utf-8
set fenc=utf-8
set fencs=utf-8,ucs-bom,gb2312,cp936,gbk,big5
set langmenu=zh_CN.UTF-8
set encoding=utf-8
set fileencoding=utf-8
set fileencodings=utf-8,ucs-bom,latin1,gb2312,gb18030,cp936,gbk,big5
set termencoding=utf-8

"设置颜色
colorscheme desert

"set guifont=Nimbus\ Mono\ L\ 12
"set guifont=WenQuanYi\ Bitmap\ Song\ 12
"set guifont=Verdana\ 10
"set guifont=Courier\ 11
"set guifont=Bitstream\ Vera\ Sans\ Mono\ 10

" 显示中文帮助
if version >= 603
    set helplang=cn
    set encoding=utf-8
endif

" Use Vim settings, rather then Vi settings (much better!).
" This must be first, because it changes other options as a side effect.
" 不要使用vi的键盘模式,而是vim自己的键盘模式
set nocompatible

" history文件中需要记录的行数
set history=100

" 显示行号
set number

" 在处理未保存或只读文件的时候,弹出确认
set confirm

" 与windows共享剪贴板
set clipboard+=unnamed

" 侦测文件类型
filetype on

" 载入文件类型插件
filetype plugin on

" 为特定文件类型载入相关缩进文件
filetype indent on

" 保存全局变量
set viminfo+=!

" 带有如下符号的单词不要被换行分割
set iskeyword+=_,$,@,%,#,-

" 语法高亮显示
syntax on

"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
""""""高亮显示gtk关键字""""""
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
syntax keyword gtkType gint gshort guint gushort gulong gdouble gfloat gchar guchar gboolean gpointer
highlight link gtkType Type

" 高亮字符,让其不受100列限制
highlight OverLength ctermbg=red ctermfg=white guibg=red guifg=white
match OverLength '\%101v.*'

" 状态行颜色
highlight StatusLine guifg=SlateBlue guibg=Yellow
highlight StatusLineNC guifg=Gray guibg=White


"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" 文件设置
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" 不要备份文件(根据自己需要取舍)
set nobackup

" 不要生成swap文件,当buffer被丢弃的时候隐藏它
setlocal noswapfile
set bufhidden=hide

" 字符间插入的像素行数目
set linespace=0

" 增强模式中的命令行自动完成操作
set wildmenu

" 在状态行上显示光标所在位置的行号和列号
set ruler
set rulerformat=%20(%2*%<%f%=\ %m%r\ %3l\ %c\ %p%%%)

" 输入的命令显示出来,看的清楚些
set showcmd

" 命令行(在状态行下)的高度,默认为1,这里是2
set cmdheight=2

" 使回格键(backspace)正常处理indent, eol, start等
set backspace=indent,eol,start

" 跨行移动
set whichwrap=b,s,<,>,[,]

" 可以在buffer的任何地方使用鼠标(类似office中在工作区双击鼠标定位)
"set mouse=a
"set selection=exclusive
"set selectmode=mouse,key

" 启动的时候不显示那个援助乌干达儿童的提示
set shortmess=atI

" 通过使用: commands命令,告诉我们文件的哪一行被改变过
set report=0

" 不让vim发出讨厌的滴滴声
set noerrorbells

" 在被分割的窗口间显示空白,便于阅读
set fillchars=vert:\ ,stl:\ ,stlnc:\

"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" 搜索和匹配
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" 高亮显示匹配的括号
set showmatch

" 匹配括号高亮的时间(单位是十分之一秒)
set matchtime=5

" 在搜索的时候忽略大小写
set ignorecase

" 不要高亮被搜索的句子(phrases)
set nohlsearch

" 在搜索时,输入的词句的逐字符高亮(类似firefox的搜索)
set incsearch

" 制表符可见
"set list

" 输入:set list命令是应该显示些啥?
set listchars=tab:\|\ ,trail:.,extends:>,precedes:<,eol:$

" 光标移动到buffer的顶部和底部时保持3行距离
set scrolloff=3

" 不要闪烁
set novisualbell

" 我的状态行显示的内容(包括文件类型和解码)
set statusline=%F%m%r%h%w\ [FORMAT=%{&ff}]\ [TYPE=%Y]\ [POS=%l,%v][%p%%]\ %{strftime(\"%d/%m/%y\ -\ %H:%M\")}

" 总是显示状态行
set laststatus=2

" 屏幕放不下时,按一次屏幕移动一个字符
set sidescroll=1

" 下面的滚动条开启
"slet g:netrw_winsize = 20et guioptions+=b

"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" 文本格式和排版
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" 自动格式化
set formatoptions=tcrqn

" 继承前一行的缩进方式,特别适用于多行注释
set autoindent

" 为C程序提供自动缩进
set smartindent

" 使用C样式的缩进
set cindent

" 制表符为4
set tabstop=4

" 统一缩进为4
set softtabstop=4
set shiftwidth=4

" 不要用空格代替制表符
set noexpandtab

" 不要换行
set nowrap

" 在行和段开始处使用制表符
set smarttab

"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" CTags的设定
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" 按照名称排序
let Tlist_Sort_Type = "name"

" 在右侧显示窗口
let Tlist_Use_Right_Window = 1

" 压缩方式
let Tlist_Compart_Format = 1

" 如果只有一个buffer,kill窗口也kill掉buffer
let Tlist_Exist_OnlyWindow = 1

" 不要关闭其他文件的tags
let Tlist_File_Fold_Auto_Close = 0

" 不要显示折叠树
let Tlist_Enable_Fold_Column = 0

"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" 键盘命令
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
"imap <C-P> <C-X><C-P>
"imap <C-F> <C-X><C-F>
"imap <C-I> <C-X><C-I>
"imap <C-D> <C-X><C-D>
"imap <C-L> <C-X><C-L>

" 根据打开文件类型, 启用智能补全
set completeopt=longest,menu
" p命令可以使用剪切板上的内容来替换选中的内容
vnoremap p <Esc>:let current_reg = @"<CR>gvs<C-R>=current_reg<CR><Esc>

nmap <F2> :nohlsearch<CR>
map <F3> :copen<CR>:grep -R
map <F7> :w<CR><CR>:copen<CR>:make<CR><CR>
imap <F7> <Esc>:w<CR><CR>:copen<CR>:make<CR><CR>
map <F8> :cclose<CR>
map <F9> :TlistToggle<CR>

"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" 代码折叠编译运行按键命令
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" 只在下列文件类型被侦测到的时候显示行号,普通文本文件不显示

if has("autocmd")
    autocmd FileType xml,html,c,cs,java,perl,shell,bash,cpp,python,vim,php,ruby set number
    autocmd FileType xml,html vmap <C-o> <ESC>'<i<!--<ESC>o<ESC>'>o-->
    autocmd FileType java,c,cpp,cs vmap <C-o> <ESC>'<o/*<ESC>'>o*/
    autocmd FileType html,text,php,vim,c,java,xml,bash,shell,perl,python setlocal textwidth=78
    autocmd Filetype html,xml,xsl source $VIMRUNTIME/plugin/closetag.vim
                \ if line("'\"") > 0 && line("'\"") <= line("{1}quot;) |
                \   exe "normal g`\"" |
                \ endif
endif " has("autocmd")

" F5编译和运行C程序,F6编译和运行C++程序
" 请注意,下述代码在windows下使用会报错
" 需要去掉./这两个字符

" C的编译和运行
map <F5> :call CompileRunGcc()<CR>
func! CompileRunGcc()
    exec "w"
    exec "!gcc % -o %<"
    exec "! ./%<"
endfunc

" C++的编译和运行
map <F6> :call CompileRunGpp()<CR>
func! CompileRunGpp()
    exec "w"
    exec "!g++ % -o %<"
    exec "! ./%<"
endfunc

" 能够漂亮地显示.NFO文件
set encoding=utf-8
function! SetFileEncodings(encodings)
    let b:myfileencodingsbak=&fileencodings
    let &fileencodings=a:encodings
endfunction
function! RestoreFileEncodings()
    let &fileencodings=b:myfileencodingsbak
    unlet b:myfileencodingsbak
endfunction

au BufReadPre *.nfo call SetFileEncodings('cp437')|set ambiwidth=single
au BufReadPost *.nfo call RestoreFileEncodings()

" 高亮显示普通txt文件(需要txt.vim脚本)
au BufRead,BufNewFile *  setfiletype txt

" 用空格键来开关折叠
set foldenable
"set foldmethod=manual
set foldmethod=syntax
set foldlevel=100
nnoremap <space> @=((foldclosed(line('.')) < 0) ? 'zc' : 'zo')<CR>

" minibufexpl插件的一般设置
let g:miniBufExplMapWindowNavVim = 1
let g:miniBufExplMapWindowNavArrows = 1
let g:miniBufExplMapCTabSwitchBufs = 1
let g:miniBufExplModSelTarget = 1

"设置快捷方式 Set mapleader
let mapleader = ","

"快捷加载,当输入",ss"时,加载  .vimrc 文件
map <silent> <leader>ss :source ~/.vimrc<cr>
"快速打开编辑 .vimrc配置文件--->",ee"
map <silent> <leader>ee :e ~/.vimrc<cr>
"快速保存文件--->",w"
map <silent> <leader>w :w<cr>
"快速保存并退出文件--->",w"
map <silent> <leader>wq :wq<cr>

"自动命令,每次写入.vimrc后,都会执行这个自动命令,source一次~/.vimrc
autocmd! bufwritepost .vimrc source ~/.vimrc

lsgx@DESKTOP-OS0DFSI:~$ 
lsgx@DESKTOP-OS0DFSI:~$ 
lsgx@DESKTOP-OS0DFSI:~$ cat ~/.tmux.conf 
#
# author   : lsgx <lsgxthink@gmail.com>
# modified : 2013-11-12
#

#-- base settings --#
set -g default-terminal "screen-256color"  # 设置终端缺省的支持颜色为256色
set -g display-time 3000     # 提示信息的持续时间;设置足够的时间以避免看不清提示,单位为毫秒
set -g escape-time 0    # 等待时间的持续时间;设置越小越好
set -g history-limit 65535    # 历史记录条数的最大限制值
#set -g base-index 1    # 窗口的初始序号;默认为0,这里设置为1
#set -g pane-base-index 1    # 面板的初始序号;默认为0,这里设置为1
#set -sg repeat-time 600    # 控制台激活后的持续时间;设置合适的时间以避免每次操作都要先激活控制台,单位为毫秒
#set -s quiet on
#setw -g xterm-keys on

#-- bindkeys --#

# prefix key (Ctrl+a)    # 将激活控制台的快捷键由Ctrl+b修改为Ctrl+a
set -g prefix ^a
unbind ^b
bind a send-prefix

# split window    # 窗口分割
unbind '"'
bind - splitw -v # vertical split (prefix -)    # 上下分割窗口
unbind %
bind | splitw -h # horizontal split (prefix |)    # 左右分割窗口

# select pane    # 选择面板
bind k selectp -U # above (prefix k)    # 选择上面板
bind j selectp -D # below (prefix j)    # 选择下面板
bind h selectp -L # left (prefix h)    # 选择左面板
bind l selectp -R # right (prefix l)    # 选择右面板

# resize pane
bind -r ^k resizep -U 2 # upward (prefix Ctrl+k)    # 当前面板上移2
bind -r ^j resizep -D 2 # downward (prefix Ctrl+j)    # 当前面板下移2
bind -r ^h resizep -L 2 # to the left (prefix Ctrl+h)    # 当前面板左移2
bind -r ^l resizep -R 2 # to the right (prefix Ctrl+l)    # 当前面板右移2

# swap pane
bind ^u swapp -U # swap with the previous pane (prefix Ctrl+u)    # 与上面板交换
bind ^d swapp -D # swap with the next pane (prefix Ctrl+d)    # 与下面板交换

# create new session
bind C-c new-session    # 创建一个新的会话

# control sessions
bind z kill-session    # 结束一个会话

# find session
bind C-f command-prompt -p find-session 'switch-client -t %%'    # 查找会话
 
# clear both screen and history
#bind -n C-l send-keys C-l \; run 'tmux clear-history'    # 清空屏幕内容和历史记录

# reload config (prefix r)
bind r source ~/.tmux.conf \; display "Configuration reloaded!"    # 重新加载配置文件

# misc
bind e lastp  # select the last pane (prefix e)    # 选择最后一个面板
bind ^e last  # select the last window (prefix Ctrl+e)    # 选择最后一个窗口
bind q killp  # kill pane (prefix q)    # 关闭当前面板
bind ^q killw # kill window (prefix Ctrl+q)    # 关闭当前窗口


# app
bind ! splitw htop                                     # htop (prefix !)
bind m command-prompt "splitw 'exec man %%'"           # man (prefix m)
bind @ command-prompt "splitw 'exec perldoc -t -f %%'" # perl func (prefix @)
bind * command-prompt "splitw 'exec perldoc -t -v %%'" # perl var (prefix *)
bind % command-prompt "splitw 'exec perldoc -t %%'"    # perl doc (prefix %)
bind / command-prompt "splitw 'exec ri %%'"            # ruby doc (prefix /)


#-- statusbar --#
#set -g status-utf8 on    # 开启状态栏的UTF-8支持
set -g status-interval 1    # 状态栏的分辨时间间隔
set -g status-keys vi    # 操作状态栏时的默认键盘布局;可以设置为vi或emacs
set -g visual-activity on    # 开启窗口操作的可视
set -g set-clipboard on    # 开启剪切板
set -g display-panes-time 800 # slightly longer pane indicators display time    # 稍长的窗格中显示的时间指标
set -g display-time 1000      # slightly longer status messages display time    # 稍长的状态消息的显示时间
set -g renumber-windows on    # renumber windows when a window is closed    # 关闭窗口后重新编号

setw -g automatic-rename on    # rename window to reflect current program    # 重命名窗口,以反映当前的程序
#setw -g utf8 on    # 开启窗口的UTF-8支持
setw -g monitor-activity on    # 开启窗口活动监视
setw -g mode-keys vi    # 复制模式中的默认键盘布局;可以设置为vi或emacs
setw -g clock-mode-style 24 # 24 hour clock    # 24小时显示方式
#setw -g mode-mouse on    # 开启鼠标模式

# copy mode
bind Enter copy-mode # enter copy mode    # 按Enter进入复制模式
bind b list-buffers  # list paster buffers    # 复制缓冲区列表
bind p paste-buffer  # paste from the top pate buffer    # 粘贴最后复制的缓冲区内容
bind P choose-buffer # choose which buffer to paste from    # 选择粘贴缓冲区

# the following vi-copy bindings match my vim settings
# see https://github.com/gpakosz/.vim.git
#bind -t vi-copy v begin-selection    # 复制模式下开始选取
#bind -t vi-copy C-v rectangle-toggle    # 复制模式下矩形选取
#bind -t vi-copy y copy-selection    # 复制模式下复制选取的内容
#bind -t vi-copy Escape cancel    # 复制模式下退出复制模式
#bind -t vi-copy H start-of-line    # 复制模式下开始行选取
#bind -t vi-copy L end-of-line    # 复制模式下结束行选取

# mouse resize selcet
#setw -g mouse-resize-pane on    # 鼠标调整面板大小
#setw -g mouse-select-pane on    # 鼠标选择面板
#setw -g mouse-select-window on    # 鼠标选择窗口

# move x clipboard into tmux paste buffer
bind C-p run "tmux set-buffer \"$(xclip -o -sel clipbaord)\"; tmux paste-buffer" 
# move tmux copy buffer into x clipboard
bind C-y run "tmux show-buffer | xclip -i -sel clipbaord"


#-- colorscheme --#
# see also: https://github.com/daethorian/conf-tmux/blob/master/colors/zenburn.conf

# modes
setw -g clock-mode-colour colour223
setw -g mode-attr bold
setw -g mode-fg colour223
setw -g mode-bg colour235

# panes
set -g pane-border-bg colour234
set -g pane-border-fg colour234
set -g pane-active-border-bg colour232
set -g pane-active-border-fg colour232


# statusbar
set -g status-justify centre
set -g status-bg colour235
set -g status-fg colour248
set -g status-attr dim

set -g status-left "#[fg=green,bright]Session: #S #[fg=yellow,bright]Window: #I #[fg=cyan,bright]Pane: #P"
set -g status-left-attr bright
set -g status-left-length 30
set -g status-right "#[fg=yellow,bright][ #[fg=cyan,bright]#W #[fg=yellow,bright]]#[default] #[fg=yellow,bright]- %Y.%m.%d #[fg=green,bright]%H:%M #[default]"
set -g status-right-attr bright
set-option -g status-right-length 30

setw -g window-status-current-fg colour223
setw -g window-status-current-bg colour237
setw -g window-status-current-attr bold
#setw -g window-status-current-format "#I:#W#F"

#setw -g window-status-alert-attr bold
#setw -g window-status-alert-fg colour255
#setw -g window-status-alert-bg colour160

# messages
set -g message-attr bold
set -g message-fg colour223
set -g message-bg colour235

lsgx@DESKTOP-OS0DFSI:~$ 
lsgx@DESKTOP-OS0DFSI:~$ 
lsgx@DESKTOP-OS0DFSI:~$ cat ~/.Xresources 
!------------------------------------------ 
! XTerm 
!------------------------------------------ 
XTerm*termName:                 xterm-color 
XTerm*visualBell:               false 
XTerm*marginBell:               false 
XTerm*alwaysHighlight:          false 
XTerm*cursorBlink:              true 
XTerm*cursorOffTime:            450 
XTerm*cursorOnTime:             900 
XTerm*highlightSelection:       true 
XTerm*saveLines:                8192 
XTerm*foreground:               rgb:a8/a8/a8 
XTerm*background:               rgb:00/00/00 
XTerm*color0:                   rgb:00/00/00 
XTerm*color1:                   rgb:a8/00/00 
XTerm*color2:                   rgb:00/a8/00 
XTerm*color3:                   rgb:a8/54/00 
XTerm*color4:                   rgb:00/00/a8 
XTerm*color5:                   rgb:a8/00/a8 
XTerm*color6:                   rgb:00/a8/a8 
XTerm*color7:                   rgb:a8/a8/a8 
XTerm*color8:                   rgb:54/54/54 
XTerm*color9:                   rgb:fc/54/54 
XTerm*color10:                  rgb:54/fc/54 
XTerm*color11:                  rgb:fc/fc/54 
XTerm*color12:                  rgb:54/54/fc 
XTerm*color13:                  rgb:fc/54/fc 
XTerm*color14:                  rgb:54/fc/fc 
XTerm*color15:                  rgb:fc/fc/fc 
XTerm*scrollBar:                true 
XTerm*rightScrollBar:           true 
XTerm*scrollKey:                false 
XTerm*scrollTtyOutput:          false 
XTerm*loginShell:               false 
XTerm*locale:                   true 
XTerm*eightBitInput:            false 
XTerm*eightBitOutput:           true 
XTerm*metaSendEscape:           true 
XTerm*faceName:                 Bitstream Vera Sans Mono 
XTerm*faceSize:                 14 
XTerm*faceNameDoublesize:       WenQuanYi Bitmap Song 
XTerm*mkWidth:                  false 
XTerm*charClass: 33:48,36-47:48,58-59:48,61:48,63-64:48,95:48,126:48

lsgx@DESKTOP-OS0DFSI:~$ 
lsgx@DESKTOP-OS0DFSI:~$ 

 

sudo passwd root
cd /etc/apt/
sudo vi sources.list
sudo nano sources.list
sudo apt-get update 
sudo apt-get install aptitude
sudo aptitude purge openssh-server openssh-sftp-server
sudo aptitude install openssh-server openssh-sftp-server
sudo vi /etc/ssh/sshd_config 
sudo nano /etc/ssh/sshd_config 
sudo service ssh --full-restart
sudo aptitude install supervisor
sudo vi /etc/init.wsl
sudo chmod +x /etc/init.wsl
sudo vi /etc/sudoers
sudo aptitude install lynx tree curl wget htop net-tools bash bash-completion xterm tmux p7zip-full dmidecode pciutils psmisc v86d hwinfo lshw smartmontools build-essential gdb gdb-doc cgdb perl perl-doc guile-2.2 guile-2.2-libs guile-2.2-doc chezscheme expect autoconf automake libtool libtool-bin libtool-doc cmake cmake-curses-gui cmake-doc git git-doc unzip ethtool binwalk hexedit xxd subversion subversion-tools fakeroot valgrind bison flex flex-doc swig libncurses5-dev libssl-dev libiconv-hook-dev dpkg-dev  
sudo aptitude install liblz4-tool bochs bochs-x bochs-sdl bochsbios bximage vgabios build-essential xorg-dev libgtk2.0-dev bison qemu-system-x86 qemu-utils qemu-system-arm qemu-efi qemu-efi-aarch64 qemu-efi-arm libvirt-clients libvirt-daemon-system virt-manager git dpkg-dev 
sudo adduser lsgx kvm
sudo adduser root kvm
sudo adduser lsgx libvirt
sudo adduser root libvirt
sudo adduser root libvirt-qemu
sudo adduser lsgx libvirt-qemu
sudo aptitude install nginx php php-dev php-fpm php-mbstring php-gd php-curl php-json php-apcu php-cli 
sudo aptitude install qt5-default qt5-doc-html qt5-doc qtcreator qtcreator-doc 
sudo aptitude install subversion mercurial mg mruby lua5.3
sudo aptitude install build-essential asciidoc binutils bzip2 gawk gettext git libncurses5-dev libz-dev patch python3 python2.7 unzip zlib1g-dev lib32gcc1 libc6-dev-i386 subversion flex uglifyjs git-core gcc-multilib p7zip p7zip-full msmtp libssl-dev texinfo libglib2.0-dev xmlto qemu-utils upx libelf-dev autoconf automake libtool autopoint device-tree-compiler g++-multilib antlr3 gperf wget curl swig rsync
sudo aptitude install doxygen graphviz doxygen-latex latex-cjk-all
sudo aptitude install open-vm-tools open-vm-tools-desktop 

sudo aptitude install ack antlr3 asciidoc autoconf automake autopoint binutils bison build-essential \
bzip2 ccache cmake cpio curl device-tree-compiler fastjar flex gawk gettext gcc-multilib g++-multilib \
git gperf haveged help2man intltool libc6-dev-i386 libelf-dev libglib2.0-dev libgmp3-dev libltdl-dev \
libmpc-dev libmpfr-dev libncurses5-dev libncursesw5-dev libreadline-dev libssl-dev libtool lrzsz \
mkisofs msmtp nano ninja-build p7zip p7zip-full patch pkgconf python2.7 python3 python3-pip libpython3-dev qemu-utils \
rsync scons squashfs-tools subversion swig texinfo uglifyjs upx-ucl unzip vim wget xmlto xxd zlib1g-dev

 

============

ditel@ditel-ubuntu:~$ sudo cat /etc/netplan/50-cloud-init.yaml 
network:
  version: 2
  ethernets:
    eno1:
      dhcp4: false
      dhcp6: false
      accept-ra: false
      link-local: []
      optional: true
    enp4s0:
      dhcp4: false
      dhcp6: false
      accept-ra: false
      link-local: []
      optional: true
    enp6s0:
      dhcp4: false
      dhcp6: false
      accept-ra: false
      link-local: []
      optional: true
    enp7s0:
      dhcp4: false
      dhcp6: false
      accept-ra: false
      link-local: []
      optional: true
  bridges:
    br0:
      dhcp4: false
      dhcp6: false
      accept-ra: false
      link-local: []
      optional: false
      interfaces: [eno1, enp4s0, enp6s0, enp7s0]
      addresses: [192.168.3.199/24]
      routes:
        - to: default
          via: 192.168.3.1
      nameservers:
        addresses: [223.5.5.5,4.2.2.1]

 

vmuser@ubuntu-vm:~$ sudo vi /etc/sysctl.d/10-network-security.conf
vmuser@ubuntu-vm:~$ 
vmuser@ubuntu-vm:~$ sudo cat /etc/sysctl.d/10-network-security.conf

# Turn on Source Address Verification in all interfaces to
# prevent some spoofing attacks.
net.ipv4.conf.default.rp_filter=2
net.ipv4.conf.all.rp_filter=2

net.ipv4.ip_forward=1

vmuser@ubuntu-vm:~$ 
vmuser@ubuntu-vm:~$ sudo vi /etc/sysctl.d/10-ipv6-privacy.conf 
vmuser@ubuntu-vm:~$ 
vmuser@ubuntu-vm:~$ sudo cat /etc/sysctl.d/10-ipv6-privacy.conf 
# IPv6 Privacy Extensions (RFC 4941)
# ---
# IPv6 typically uses a device's MAC address when choosing an IPv6 address
# to use in autoconfiguration. Privacy extensions allow using a randomly
# generated IPv6 address, which increases privacy.
#
# Acceptable values:
#    0 - don’t use privacy extensions.
#    1 - generate privacy addresses
#    2 - prefer privacy addresses and use them over the normal addresses.
net.ipv6.conf.all.use_tempaddr = 2
net.ipv6.conf.default.use_tempaddr = 2

net.ipv6.conf.default.disable_ipv6 = 1
net.ipv6.conf.all.disable_ipv6 = 1
net.ipv6.conf.lo.disable_ipv6 = 1

vmuser@ubuntu-vm:~$ 

 

vmuser@ubuntu-vm:~$ 
vmuser@ubuntu-vm:~$ ip addr show
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host noprefixroute 
       valid_lft forever preferred_lft forever
2: ens33: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
    link/ether 00:0c:29:6d:d9:f2 brd ff:ff:ff:ff:ff:ff
    altname enp2s1
    inet 192.168.11.192/24 metric 100 brd 192.168.11.255 scope global ens33
       valid_lft forever preferred_lft forever
    inet6 fe80::20c:29ff:fe6d:d9f2/64 scope link 
       valid_lft forever preferred_lft forever
3: ens34: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
    link/ether 00:0c:29:6d:d9:fc brd ff:ff:ff:ff:ff:ff
    altname enp2s2
    inet 192.168.1.6/24 metric 100 brd 192.168.1.255 scope global dynamic ens34
       valid_lft 86339sec preferred_lft 86339sec
    inet6 2409:8a28:20a0:7b50:20c:29ff:fe6d:d9fc/64 scope global dynamic mngtmpaddr noprefixroute 
       valid_lft 2807sec preferred_lft 2807sec
    inet6 fe80::20c:29ff:fe6d:d9fc/64 scope link 
       valid_lft forever preferred_lft forever
vmuser@ubuntu-vm:~$ 
vmuser@ubuntu-vm:~$ cat /etc/apt/sources.list
# Ubuntu sources have moved to /etc/apt/sources.list.d/ubuntu.sources
vmuser@ubuntu-vm:~$ 
vmuser@ubuntu-vm:~$ cat /etc/apt/sources.list.d/ubuntu.sources
Types: deb
URIs: https://repo.huaweicloud.com/ubuntu/
Suites: noble noble-updates noble-backports
Components: main restricted universe multiverse
Signed-By: /usr/share/keyrings/ubuntu-archive-keyring.gpg

Types: deb
URIs: http://security.ubuntu.com/ubuntu/
Suites: noble-security
Components: main restricted universe multiverse
Signed-By: /usr/share/keyrings/ubuntu-archive-keyring.gpg
vmuser@ubuntu-vm:~$ 
vmuser@ubuntu-vm:~$ sudo apt update
vmuser@ubuntu-vm:~$ 
vmuser@ubuntu-vm:~$ sudo apt install aptitude
vmuser@ubuntu-vm:~$ 
vmuser@ubuntu-vm:~$ sudo systemctl restart networkd-dispatcher.service
vmuser@ubuntu-vm:~$ 
vmuser@ubuntu-vm:~$ sudo systemctl restart unattended-upgrades.service
vmuser@ubuntu-vm:~$ 
vmuser@ubuntu-vm:~$ sudo aptitude install openvswitch-switch
vmuser@ubuntu-vm:~$ 
vmuser@ubuntu-vm:~$ 
vmuser@ubuntu-vm:~$ cd /etc/netplan/
vmuser@ubuntu-vm:/etc/netplan$ 
vmuser@ubuntu-vm:/etc/netplan$ sudo vi 50-cloud-init.yaml 
vmuser@ubuntu-vm:/etc/netplan$ 
vmuser@ubuntu-vm:/etc/netplan$ sudo cat 50-cloud-init.yaml 
network:
  version: 2
  ethernets:
    ens33:
      dhcp4: true
dhcp4-overrides:
route-metric: 15 dhcp6: false accept-ra: false link-local: [] optional: true ens34: dhcp4: true
dhcp4-overrides:
route-metric: 16 dhcp6: false accept-ra: false link-local: [] optional: true vmuser@ubuntu-vm:/etc/netplan$ vmuser@ubuntu-vm:/etc/netplan$ vmuser@ubuntu-vm:/etc/netplan$ ls -alh total 12K drwxr-xr-x 2 root root 4.0K Jul 5 03:36 . drwxr-xr-x 109 root root 4.0K Jul 5 03:33 .. -rw------- 1 root root 261 Jul 5 03:36 50-cloud-init.yaml vmuser@ubuntu-vm:/etc/netplan$ vmuser@ubuntu-vm:/etc/netplan$ vmuser@ubuntu-vm:/etc/netplan$ sudo netplan apply vmuser@ubuntu-vm:/etc/netplan$ vmuser@ubuntu-vm:/etc/netplan$ vmuser@ubuntu-vm:/etc/netplan$ cd ~ vmuser@ubuntu-vm:~$ vmuser@ubuntu-vm:~$ sudo ufw allow ssh Rules updated Rules updated (v6) vmuser@ubuntu-vm:~$ vmuser@ubuntu-vm:~$ sudo ufw disable Firewall stopped and disabled on system startup vmuser@ubuntu-vm:~$ vmuser@ubuntu-vm:~$ vmuser@ubuntu-vm:~$ sudo ufw status Status: inactive vmuser@ubuntu-vm:~$ vmuser@ubuntu-vm:~$ sudo vi /etc/systemd/resolved.conf vmuser@ubuntu-vm:~$ vmuser@ubuntu-vm:~$ sudo cat /etc/systemd/resolved.conf # This file is part of systemd. # # systemd is free software; you can redistribute it and/or modify it under the # terms of the GNU Lesser General Public License as published by the Free # Software Foundation; either version 2.1 of the License, or (at your option) # any later version. # # Entries in this file show the compile time defaults. Local configuration # should be created by either modifying this file (or a copy of it placed in # /etc/ if the original file is shipped in /usr/), or by creating "drop-ins" in # the /etc/systemd/resolved.conf.d/ directory. The latter is generally # recommended. Defaults can be restored by simply deleting the main # configuration file and all drop-ins located in /etc/. # # Use 'systemd-analyze cat-config systemd/resolved.conf' to display the full config. # # See resolved.conf(5) for details. [Resolve] # Some examples of DNS servers which may be used for DNS= and FallbackDNS=: # Cloudflare: 1.1.1.1#cloudflare-dns.com 1.0.0.1#cloudflare-dns.com 2606:4700:4700::1111#cloudflare-dns.com 2606:4700:4700::1001#cloudflare-dns.com # Google: 8.8.8.8#dns.google 8.8.4.4#dns.google 2001:4860:4860::8888#dns.google 2001:4860:4860::8844#dns.google # Quad9: 9.9.9.9#dns.quad9.net 149.112.112.112#dns.quad9.net 2620:fe::fe#dns.quad9.net 2620:fe::9#dns.quad9.net DNS=223.5.5.5 #FallbackDNS= #Domains= #DNSSEC=no #DNSOverTLS=no #MulticastDNS=no #LLMNR=no #Cache=no-negative #CacheFromLocalhost=no #DNSStubListener=yes #DNSStubListenerExtra= #ReadEtcHosts=yes #ResolveUnicastSingleLabel=no #StaleRetentionSec=0 vmuser@ubuntu-vm:~$ vmuser@ubuntu-vm:~$ sudo systemctl restart systemd-resolved.service vmuser@ubuntu-vm:~$ vmuser@ubuntu-vm:~$ sudo systemd-resolve --status Global DNS Servers: 223.5.5.5 DNSSEC NTA: 10.in-addr.arpa 16.172.in-addr.arpa 168.192.in-addr.arpa 17.172.in-addr.arpa 18.172.in-addr.arpa 19.172.in-addr.arpa 20.172.in-addr.arpa 21.172.in-addr.arpa 22.172.in-addr.arpa 23.172.in-addr.arpa 24.172.in-addr.arpa 25.172.in-addr.arpa 26.172.in-addr.arpa 27.172.in-addr.arpa 28.172.in-addr.arpa 29.172.in-addr.arpa 30.172.in-addr.arpa 31.172.in-addr.arpa corp d.f.ip6.arpa home internal intranet lan local private test Link 2 (ens160) Current Scopes: DNS LLMNR setting: yes MulticastDNS setting: no DNSSEC setting: no DNSSEC supported: no DNS Servers: 223.5.5.5 vmuser@ubuntu-vm:~$ vmuser@ubuntu-vm:~$ sudo timedatectl set-timezone Asia/Shanghai vmuser@ubuntu-vm:~$ vmuser@ubuntu-vm:~$ sudo vi /etc/systemd/timesyncd.conf vmuser@ubuntu-vm:~$ vmuser@ubuntu-vm:~$ vmuser@ubuntu-vm:~$ sudo cat /etc/systemd/timesyncd.conf # This file is part of systemd. # # systemd is free software; you can redistribute it and/or modify it under the # terms of the GNU Lesser General Public License as published by the Free # Software Foundation; either version 2.1 of the License, or (at your option) # any later version. # # Entries in this file show the compile time defaults. Local configuration # should be created by either modifying this file (or a copy of it placed in # /etc/ if the original file is shipped in /usr/), or by creating "drop-ins" in # the /etc/systemd/timesyncd.conf.d/ directory. The latter is generally # recommended. Defaults can be restored by simply deleting the main # configuration file and all drop-ins located in /etc/. # # Use 'systemd-analyze cat-config systemd/timesyncd.conf' to display the full config. # # See timesyncd.conf(5) for details. [Time] NTP=120.25.115.20 #FallbackNTP=ntp.ubuntu.com #RootDistanceMaxSec=5 #PollIntervalMinSec=32 #PollIntervalMaxSec=2048 #ConnectionRetrySec=30 #SaveIntervalSec=60 vmuser@ubuntu-vm:~$ vmuser@ubuntu-vm:~$ sudo systemctl restart systemd-timesyncd.service vmuser@ubuntu-vm:~$ vmuser@ubuntu-vm:~$ sudo vi /etc/sysctl.d/10-network-security.conf vmuser@ubuntu-vm:~$ vmuser@ubuntu-vm:~$ sudo vi /etc/sysctl.d/10-ipv6-privacy.conf vmuser@ubuntu-vm:~$ vmuser@ubuntu-vm:~$ sudo aptitude install htop net-tools bridge-utils iptables-persistent vmuser@ubuntu-vm:~$ vmuser@ubuntu-vm:~$ sudo netfilter-persistent save run-parts: executing /usr/share/netfilter-persistent/plugins.d/15-ip4tables save run-parts: executing /usr/share/netfilter-persistent/plugins.d/25-ip6tables save vmuser@ubuntu-vm:~$ vmuser@ubuntu-vm:~$ sudo cat /etc/iptables/rules.v4 # Generated by iptables-save v1.8.10 (nf_tables) on Sat Jul 5 11:40:24 2025 *filter :INPUT ACCEPT [719:304404] :FORWARD ACCEPT [0:0] :OUTPUT ACCEPT [625:106175] COMMIT # Completed on Sat Jul 5 11:40:24 2025 vmuser@ubuntu-vm:~$ vmuser@ubuntu-vm:~$ sudo cat /etc/iptables/rules.v6 # Generated by ip6tables-save v1.8.10 (nf_tables) on Sat Jul 5 11:40:24 2025 *filter :INPUT ACCEPT [2:152] :FORWARD ACCEPT [0:0] :OUTPUT ACCEPT [0:0] COMMIT # Completed on Sat Jul 5 11:40:24 2025 vmuser@ubuntu-vm:~$ vmuser@ubuntu-vm:~$ sudo reboot vmuser@ubuntu-vm:~$
vmuser@ubuntu-vm:~$ 
vmuser@ubuntu-vm:~$ sudo aptitude install lynx tree curl wget htop net-tools bash bash-completion xterm tmux p7zip-full dmidecode pciutils psmisc v86d hwinfo lshw smartmontools build-essential gdb gdb-doc cgdb perl perl-doc guile-2.2 guile-2.2-libs guile-2.2-doc chezscheme expect autoconf automake libtool libtool-bin libtool-doc cmake cmake-curses-gui cmake-doc git git-doc unzip ethtool binwalk hexedit xxd subversion subversion-tools fakeroot valgrind bison flex flex-doc swig libncurses5-dev libssl-dev libiconv-hook-dev dpkg-dev
vmuser@ubuntu-vm:~$ 
vmuser@ubuntu-vm:~$ sudo aptitude install doxygen graphviz doxygen-latex latex-cjk-all vmuser@ubuntu-vm:~$ 
vmuser@ubuntu-vm:~$ sudo aptitude install ack antlr3 asciidoc autoconf automake autopoint binutils bison build-essential bzip2 ccache clang cmake cpio curl device-tree-compiler ecj fastjar flex gawk gettext gcc-multilib g++-multilib git gnutls-dev gperf haveged help2man intltool lib32gcc-s1 libc6-dev-i386 libelf-dev libglib2.0-dev libgmp3-dev libltdl-dev libmpc-dev libmpfr-dev libncurses-dev libpython3-dev libreadline-dev libssl-dev libtool libyaml-dev libz-dev lld llvm lrzsz mkisofs msmtp nano ninja-build p7zip p7zip-full patch pkgconf python3 python3-pip python3-ply python3-docutils python3-pyelftools qemu-utils re2c rsync scons squashfs-tools subversion swig texinfo uglifyjs upx-ucl unzip vim wget xmlto xxd zlib1g-dev zstd vmuser@ubuntu-vm:~$ vmuser@ubuntu-vm:~$ sudo aptitude install bash-completion gdbserver build-essential checkinstall libncursesw5-dev libssl-dev libsqlite3-dev tk-dev libgdbm-dev libc6-dev libbz2-dev libffi-dev libtool intltool autoconf automake libcurl4-openssl-dev pkg-config libglib2.0-dev libgtk-3-dev libgoocanvas-2.0-dev libev-dev libssl-dev vmuser@ubuntu-vm:~$ vmuser@ubuntu-vm:~$ vmuser@ubuntu-vm:~$ df -Th Filesystem Type Size Used Avail Use% Mounted on tmpfs tmpfs 197M 1.1M 196M 1% /run efivarfs efivarfs 256K 63K 189K 25% /sys/firmware/efi/efivars /dev/mapper/ubuntu--vg-ubuntu--lv ext4 87G 9.7G 73G 12% / tmpfs tmpfs 984M 0 984M 0% /dev/shm tmpfs tmpfs 5.0M 0 5.0M 0% /run/lock /dev/sda2 ext4 2.0G 101M 1.7G 6% /boot /dev/sda1 vfat 1.1G 6.2M 1.1G 1% /boot/efi tmpfs tmpfs 197M 12K 197M 1% /run/user/1000 tmpfs tmpfs 984M 0 984M 0% /run/qemu vmuser@ubuntu-vm:~$ vmuser@ubuntu-vm:~$ git -c http.sslVerify=false clone --recursive https://110.42.96.64:21891/jjx/rtty Cloning into 'rtty'... remote: Enumerating objects: 82, done. remote: Counting objects: 100% (82/82), done. remote: Compressing objects: 100% (74/74), done. remote: Total 82 (delta 16), reused 26 (delta 2), pack-reused 0 (from 0) Receiving objects: 100% (82/82), 1.50 MiB | 16.51 MiB/s, done. Resolving deltas: 100% (16/16), done. vmuser@ubuntu-vm:~$ vmuser@ubuntu-vm:~$ vmuser@ubuntu-vm:~$ cd rtty/ vmuser@ubuntu-vm:~/rtty$ vmuser@ubuntu-vm:~/rtty$ mkdir build vmuser@ubuntu-vm:~/rtty$ vmuser@ubuntu-vm:~/rtty$ cd build/ vmuser@ubuntu-vm:~/rtty/build$ vmuser@ubuntu-vm:~/rtty/build$ cmake ../ CMake Deprecation Warning at CMakeLists.txt:1 (cmake_minimum_required): Compatibility with CMake < 3.5 will be removed from a future version of CMake. Update the VERSION argument <min> value or use a ...<max> suffix to tell CMake that the project does not need compatibility with older versions. -- The C compiler identification is GNU 13.3.0 -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Check for working C compiler: /usr/bin/cc - skipped -- Detecting C compile features -- Detecting C compile features - done -- Found Libev: /usr/lib/x86_64-linux-gnu/libev.so (found version "4.33") -- Checking for module 'openssl' -- Found openssl, version 3.0.13 -- Could NOT find WolfSSL (missing: WOLFSSL_LIBRARY WOLFSSL_INCLUDE_DIR) -- Could NOT find MbedTLS (missing: MBEDTLS_LIBRARY MBEDX509_LIBRARY MBEDCRYPTO_LIBRARY MBEDTLS_INCLUDE_DIR) -- Found ZLIB: /usr/lib/x86_64-linux-gnu/libz.so (found version "1.3") -- Select OpenSSL as the SSL backend -- Configuring done (0.4s) -- Generating done (0.0s) -- Build files have been written to: /home/vmuser/rtty/build vmuser@ubuntu-vm:~/rtty/build$ vmuser@ubuntu-vm:~/rtty/build$ vmuser@ubuntu-vm:~/rtty/build$ make [ 7%] Building C object src/ssl/CMakeFiles/xssl.dir/openssl.c.o [ 15%] Linking C static library libxssl.a [ 15%] Built target xssl [ 23%] Building C object src/CMakeFiles/rtty.dir/command.c.o [ 30%] Building C object src/CMakeFiles/rtty.dir/file.c.o [ 38%] Building C object src/CMakeFiles/rtty.dir/filectl.c.o [ 46%] Building C object src/CMakeFiles/rtty.dir/http.c.o [ 53%] Building C object src/CMakeFiles/rtty.dir/main.c.o [ 61%] Building C object src/CMakeFiles/rtty.dir/net.c.o [ 69%] Building C object src/CMakeFiles/rtty.dir/rtty.c.o [ 76%] Building C object src/CMakeFiles/rtty.dir/utils.c.o [ 84%] Building C object src/CMakeFiles/rtty.dir/log/log.c.o [ 92%] Building C object src/CMakeFiles/rtty.dir/buffer/buffer.c.o [100%] Linking C executable rtty [100%] Built target rtty vmuser@ubuntu-vm:~/rtty/build$ vmuser@ubuntu-vm:~/rtty/build$ sudo make install [ 15%] Built target xssl [100%] Built target rtty Install the project... -- Install configuration: "" -- Installing: /usr/local/bin/rtty vmuser@ubuntu-vm:~/rtty/build$ vmuser@ubuntu-vm:~/rtty/build$ sudo /usr/local/bin/rtty -h 110.42.96.64 -p 53802 -I ubuntu-vm -a -t 45eec2ab2c19981d6ab67df9e68c896e ^Cvmuser@ubuntu-vm:~/rtty/build$ vmuser@ubuntu-vm:~/rtty/build$ sudo vi /usr/lib/systemd/system/rtty.service vmuser@ubuntu-vm:~/rtty/build$ vmuser@ubuntu-vm:~/rtty/build$ vmuser@ubuntu-vm:~/rtty/build$ sudo cat /usr/lib/systemd/system/rtty.service [Unit] Description=rtty Wants=network-online.target After=network.target network-online.target Requires=network-online.target [Service] ExecStart=/usr/local/bin/rtty -h 110.42.96.64 -p 53802 -I ubuntu-vm -a -t 45eec2ab2c19981d6ab67df9e68c896e ExecStop=/bin/kill $MAINPID Restart=always RestartSec=5 StartLimitInterval=0 [Install] WantedBy=multi-user.target vmuser@ubuntu-vm:~/rtty/build$ vmuser@ubuntu-vm:~/rtty/build$ vmuser@ubuntu-vm:~/rtty/build$ vmuser@ubuntu-vm:~/rtty/build$ vmuser@ubuntu-vm:~/rtty/build$ cd ~ vmuser@ubuntu-vm:~$ vmuser@ubuntu-vm:~$ vmuser@ubuntu-vm:~$ vmuser@ubuntu-vm:~$ rm -rf rtty vmuser@ubuntu-vm:~$ vmuser@ubuntu-vm:~$ sudo systemctl daemon-reload vmuser@ubuntu-vm:~$ vmuser@ubuntu-vm:~$ sudo systemctl stop rtty vmuser@ubuntu-vm:~$ vmuser@ubuntu-vm:~$ sudo systemctl start rtty vmuser@ubuntu-vm:~$ vmuser@ubuntu-vm:~$ sudo systemctl status rtty ● rtty.service - rtty Loaded: loaded (/usr/lib/systemd/system/rtty.service; disabled; preset: enabled) Active: active (running) since Sat 2025-07-05 12:01:10 CST; 4s ago Main PID: 18974 (rtty) Tasks: 1 (limit: 2266) Memory: 1.8M (peak: 2.4M) CPU: 38ms CGroup: /system.slice/rtty.service └─18974 /usr/local/bin/rtty -h 110.42.96.64 -p 53802 -I ubuntu-vm -a -t 45eec2ab2c19981d> Jul 05 12:01:10 ubuntu-vm systemd[1]: Started rtty.service - rtty. vmuser@ubuntu-vm:~$ vmuser@ubuntu-vm:~$ vmuser@ubuntu-vm:~$ sudo systemctl enable rtty Created symlink /etc/systemd/system/multi-user.target.wants/rtty.service → /usr/lib/systemd/system/rtty.service. vmuser@ubuntu-vm:~$ vmuser@ubuntu-vm:~$ vmuser@ubuntu-vm:~$ ls -alh total 38M drwxr-x--- 4 vmuser vmuser 4.0K Jul 5 12:00 . drwxr-xr-x 3 root root 4.0K Jul 5 11:30 .. -rw------- 1 vmuser vmuser 1.1K Jul 5 11:46 .bash_history -rw-r--r-- 1 vmuser vmuser 220 Mar 31 2024 .bash_logout -rw-r--r-- 1 vmuser vmuser 3.7K Mar 31 2024 .bashrc drwx------ 2 vmuser vmuser 4.0K Jul 5 11:31 .cache -rw-rw-r-- 1 vmuser vmuser 12K Jul 5 11:55 init_build_environment.sh -rw-r--r-- 1 vmuser vmuser 807 Mar 31 2024 .profile -rw-rw-r-- 1 vmuser vmuser 38M Jul 5 11:55 Python-2.7.18-build.tgz drwx------ 2 vmuser vmuser 4.0K Jul 5 11:30 .ssh -rw-r--r-- 1 vmuser vmuser 0 Jul 5 11:32 .sudo_as_admin_successful -rw------- 1 vmuser vmuser 55 Jul 5 11:31 .Xauthority vmuser@ubuntu-vm:~$ vmuser@ubuntu-vm:~$ vmuser@ubuntu-vm:~$ tar -zxvpf Python-2.7.18-build.tgz vmuser@ubuntu-vm:~$ vmuser@ubuntu-vm:~$ vmuser@ubuntu-vm:~$ cd Python-2.7.18/ vmuser@ubuntu-vm:~/Python-2.7.18$ vmuser@ubuntu-vm:~/Python-2.7.18$ sudo make install vmuser@ubuntu-vm:~/Python-2.7.18$ vmuser@ubuntu-vm:~/Python-2.7.18$ vmuser@ubuntu-vm:~/Python-2.7.18$ cd ~ vmuser@ubuntu-vm:~$ vmuser@ubuntu-vm:~$ vmuser@ubuntu-vm:~$ python2.7 -V Python 2.7.18 vmuser@ubuntu-vm:~$ vmuser@ubuntu-vm:~$ sudo python2.7 get-pip.py DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. pip 21.0 will drop support for Python 2.7 in January 2021. More details about Python 2 support in pip can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support pip 21.0 will remove support for this functionality. Collecting pip<21.0 Downloading pip-20.3.4-py2.py3-none-any.whl (1.5 MB) |████████████████████████████████| 1.5 MB 858 kB/s Collecting setuptools<45 Downloading setuptools-44.1.1-py2.py3-none-any.whl (583 kB) |████████████████████████████████| 583 kB 13.4 MB/s Collecting wheel Downloading wheel-0.37.1-py2.py3-none-any.whl (35 kB) Installing collected packages: pip, setuptools, wheel Successfully installed pip-20.3.4 setuptools-44.1.1 wheel-0.37.1 vmuser@ubuntu-vm:~$ vmuser@ubuntu-vm:~$ vmuser@ubuntu-vm:~$ pip2.7 --version pip 20.3.4 from /usr/local/lib/python2.7/site-packages/pip (python 2.7) vmuser@ubuntu-vm:~$ vmuser@ubuntu-vm:~$ chmod +x init_build_environment.sh vmuser@ubuntu-vm:~$ vmuser@ubuntu-vm:~$ sudo ./init_build_environment.sh vmuser@ubuntu-vm:~$ vmuser@ubuntu-vm:~$ vmuser@ubuntu-vm:~$ sudo vi /etc/apt/sources.list vmuser@ubuntu-vm:~$ vmuser@ubuntu-vm:~$ sudo cat /etc/apt/sources.list deb https://repo.huaweicloud.com/ubuntu/ noble main restricted universe multiverse deb-src https://repo.huaweicloud.com/ubuntu/ noble main restricted universe multiverse deb https://repo.huaweicloud.com/ubuntu/ noble-security main restricted universe multiverse deb-src https://repo.huaweicloud.com/ubuntu/ noble-security main restricted universe multiverse deb https://repo.huaweicloud.com/ubuntu/ noble-updates main restricted universe multiverse deb-src https://repo.huaweicloud.com/ubuntu/ noble-updates main restricted universe multiverse # deb https://repo.huaweicloud.com/ubuntu/ noble-proposed main restricted universe multiverse # deb-src https://repo.huaweicloud.com/ubuntu/ noble-proposed main restricted universe multiverse deb https://repo.huaweicloud.com/ubuntu/ noble-backports main restricted universe multiverse deb-src https://repo.huaweicloud.com/ubuntu/ noble-backports main restricted universe multiverse vmuser@ubuntu-vm:~$ vmuser@ubuntu-vm:~$ vmuser@ubuntu-vm:~$ sudo vi /etc/apt/sources.list.d/ubuntu.sources vmuser@ubuntu-vm:~$ vmuser@ubuntu-vm:~$ vmuser@ubuntu-vm:~$ sudo cat /etc/apt/sources.list.d/ubuntu.sources # See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to # newer versions of the distribution. ## Ubuntu distribution repository ## ## The following settings can be adjusted to configure which packages to use from Ubuntu. ## Mirror your choices (except for URIs and Suites) in the security section below to ## ensure timely security updates. ## ## Types: Append deb-src to enable the fetching of source package. ## URIs: A URL to the repository (you may add multiple URLs) ## Suites: The following additional suites can be configured ## <name>-updates - Major bug fix updates produced after the final release of the ## distribution. ## <name>-backports - software from this repository may not have been tested as ## extensively as that contained in the main release, although it includes ## newer versions of some applications which may provide useful features. ## Also, please note that software in backports WILL NOT receive any review ## or updates from the Ubuntu security team. ## Components: Aside from main, the following components can be added to the list ## restricted - Software that may not be under a free license, or protected by patents. ## universe - Community maintained packages. Software in this repository receives maintenance ## from volunteers in the Ubuntu community, or a 10 year security maintenance ## commitment from Canonical when an Ubuntu Pro subscription is attached. ## multiverse - Community maintained of restricted. Software from this repository is ## ENTIRELY UNSUPPORTED by the Ubuntu team, and may not be under a free ## licence. Please satisfy yourself as to your rights to use the software. ## Also, please note that software in multiverse WILL NOT receive any ## review or updates from the Ubuntu security team. ## ## See the sources.list(5) manual page for further settings. Types: deb URIs: http://archive.ubuntu.com/ubuntu/ Suites: noble noble-updates noble-backports Components: main universe restricted multiverse Signed-By: /usr/share/keyrings/ubuntu-archive-keyring.gpg ## Ubuntu security updates. Aside from URIs and Suites, ## this should mirror your choices in the previous section. Types: deb URIs: http://security.ubuntu.com/ubuntu/ Suites: noble-security Components: main universe restricted multiverse Signed-By: /usr/share/keyrings/ubuntu-archive-keyring.gpg vmuser@ubuntu-vm:~$ vmuser@ubuntu-vm:~$ sudo aptitude update vmuser@ubuntu-vm:~$ vmuser@ubuntu-vm:~$ vmuser@ubuntu-vm:~$ rm -rf get-pip.py init_build_environment.sh Python-2.7.18* vmuser@ubuntu-vm:~$ vmuser@ubuntu-vm:~$ sync vmuser@ubuntu-vm:~$ vmuser@ubuntu-vm:~$ vmuser@ubuntu-vm:~$ sudo apt remove --autoremove open-vm-tools vmuser@ubuntu-vm:~$ vmuser@ubuntu-vm:~$ sudo apt-get install open-vm-tools vmuser@ubuntu-vm:~$ vmuser@ubuntu-vm:~$ sudo systemctl status open-vm-tools.service ● open-vm-tools.service - Service for virtual machines hosted on VMware Loaded: loaded (/usr/lib/systemd/system/open-vm-tools.service; enabled; preset: enabled) Active: active (running) since Sat 2025-07-05 12:12:47 CST; 23s ago Docs: http://open-vm-tools.sourceforge.net/about.php Main PID: 27010 (vmtoolsd) Tasks: 4 (limit: 2266) Memory: 1.6M (peak: 2.2M) CPU: 111ms CGroup: /system.slice/open-vm-tools.service └─27010 /usr/bin/vmtoolsd Jul 05 12:12:47 ubuntu-vm systemd[1]: Started open-vm-tools.service - Service for virtual machines ho> vmuser@ubuntu-vm:~$ vmuser@ubuntu-vm:~$ vmuser@ubuntu-vm:~$ vmuser@ubuntu-vm:~$ sudo vi /lib/systemd/system/systemd-networkd-wait-online@.service vmuser@ubuntu-vm:~$ vmuser@ubuntu-vm:~$ sudo vi /lib/systemd/system/systemd-networkd-wait-online.service vmuser@ubuntu-vm:~$ vmuser@ubuntu-vm:~$ vmuser@ubuntu-vm:~$ sudo cat /lib/systemd/system/systemd-networkd-wait-online.service # SPDX-License-Identifier: LGPL-2.1-or-later # # This file is part of systemd. # # systemd is free software; you can redistribute it and/or modify it # under the terms of the GNU Lesser General Public License as published by # the Free Software Foundation; either version 2.1 of the License, or # (at your option) any later version. [Unit] Description=Wait for Network to be Configured Documentation=man:systemd-networkd-wait-online.service(8) ConditionCapability=CAP_NET_ADMIN DefaultDependencies=no Conflicts=shutdown.target BindsTo=systemd-networkd.service After=systemd-networkd.service Before=network-online.target shutdown.target [Service] Type=oneshot ExecStart=/usr/lib/systemd/systemd-networkd-wait-online RemainAfterExit=yes # add timeout param TimeoutStartSec=2sec [Install] WantedBy=network-online.target vmuser@ubuntu-vm:~$ vmuser@ubuntu-vm:~$ vmuser@ubuntu-vm:~$ vmuser@ubuntu-vm:~$ sudo vi /etc/systemd/sleep.conf vmuser@ubuntu-vm:~$ vmuser@ubuntu-vm:~$ sudo cat /etc/systemd/sleep.conf # This file is part of systemd. # # systemd is free software; you can redistribute it and/or modify it under the # terms of the GNU Lesser General Public License as published by the Free # Software Foundation; either version 2.1 of the License, or (at your option) # any later version. # # Entries in this file show the compile time defaults. Local configuration # should be created by either modifying this file (or a copy of it placed in # /etc/ if the original file is shipped in /usr/), or by creating "drop-ins" in # the /etc/systemd/sleep.conf.d/ directory. The latter is generally # recommended. Defaults can be restored by simply deleting the main # configuration file and all drop-ins located in /etc/. # # Use 'systemd-analyze cat-config systemd/sleep.conf' to display the full config. # # See systemd-sleep.conf(5) for details. [Sleep] AllowSuspend=no AllowHibernation=no AllowSuspendThenHibernate=no AllowHybridSleep=no #SuspendState=mem standby freeze #HibernateMode=platform shutdown #HibernateDelaySec= #SuspendEstimationSec=60min vmuser@ubuntu-vm:~$ vmuser@ubuntu-vm:~$ vmuser@ubuntu-vm:~$ vmuser@ubuntu-vm:~$ sudo systemctl status snapd.service ○ snapd.service - Snap Daemon Loaded: loaded (/usr/lib/systemd/system/snapd.service; enabled; preset: enabled) Active: inactive (dead) since Sat 2025-07-05 11:46:52 CST; 32min ago Duration: 8.004s TriggeredBy: ● snapd.socket Main PID: 956 (code=exited, status=42) CPU: 335ms Jul 05 11:46:44 ubuntu-vm snapd[956]: patch.go:64: Patching system state level 6 to sublevel 3... Jul 05 11:46:44 ubuntu-vm snapd[956]: daemon.go:250: started snapd/2.66.1+24.04 (series 16; classic) > Jul 05 11:46:44 ubuntu-vm snapd[956]: daemon.go:353: adjusting startup timeout by 30s (pessimistic es> Jul 05 11:46:44 ubuntu-vm snapd[956]: backends.go:58: AppArmor status: apparmor is enabled and all fe> Jul 05 11:46:44 ubuntu-vm systemd[1]: Started snapd.service - Snap Daemon. Jul 05 11:46:49 ubuntu-vm snapd[956]: daemon.go:548: gracefully waiting for running hooks Jul 05 11:46:49 ubuntu-vm snapd[956]: daemon.go:550: done waiting for running hooks Jul 05 11:46:52 ubuntu-vm snapd[956]: overlord.go:518: Released state lock file Jul 05 11:46:52 ubuntu-vm snapd[956]: daemon stop requested to wait for socket activation Jul 05 11:46:52 ubuntu-vm systemd[1]: snapd.service: Deactivated successfully. vmuser@ubuntu-vm:~$ vmuser@ubuntu-vm:~$ vmuser@ubuntu-vm:~$ vmuser@ubuntu-vm:~$ sudo systemctl status snapd.socket ● snapd.socket - Socket activation for snappy daemon Loaded: loaded (/usr/lib/systemd/system/snapd.socket; enabled; preset: enabled) Active: active (listening) since Sat 2025-07-05 11:46:43 CST; 33min ago Triggers: ● snapd.service Listen: /run/snapd.socket (Stream) /run/snapd-snap.socket (Stream) Tasks: 0 (limit: 2266) Memory: 0B (peak: 0B) CPU: 651us CGroup: /system.slice/snapd.socket Jul 05 11:46:43 ubuntu-vm systemd[1]: Starting snapd.socket - Socket activation for snappy daemon... Jul 05 11:46:43 ubuntu-vm systemd[1]: Listening on snapd.socket - Socket activation for snappy daemon. vmuser@ubuntu-vm:~$ vmuser@ubuntu-vm:~$ vmuser@ubuntu-vm:~$ sudo systemctl status snapd.seeded.service ● snapd.seeded.service - Wait until snapd is fully seeded Loaded: loaded (/usr/lib/systemd/system/snapd.seeded.service; enabled; preset: enabled) Active: active (exited) since Sat 2025-07-05 11:46:44 CST; 33min ago Main PID: 955 (code=exited, status=0/SUCCESS) CPU: 77ms Jul 05 11:46:43 ubuntu-vm systemd[1]: Starting snapd.seeded.service - Wait until snapd is fully seede> Jul 05 11:46:44 ubuntu-vm systemd[1]: Finished snapd.seeded.service - Wait until snapd is fully seede> vmuser@ubuntu-vm:~$ vmuser@ubuntu-vm:~$ vmuser@ubuntu-vm:~$ snap list No snaps are installed yet. Try 'snap install hello-world'. vmuser@ubuntu-vm:~$ vmuser@ubuntu-vm:~$ vmuser@ubuntu-vm:~$ sudo vi /etc/apt/preferences.d/nosnap.pref vmuser@ubuntu-vm:~$ vmuser@ubuntu-vm:~$ sudo cat /etc/apt/preferences.d/nosnap.pref # To prevent repository packages from triggering the installation of snap, # this file forbids snapd from being installed by APT. Package: snapd Pin: release a=* Pin-Priority: -10 vmuser@ubuntu-vm:~$ vmuser@ubuntu-vm:~$ vmuser@ubuntu-vm:~$ sudo apt remove --autoremove snapd Reading package lists... Done Building dependency tree... Done Reading state information... Done The following packages will be REMOVED: snapd ubuntu-server-minimal 0 upgraded, 0 newly installed, 2 to remove and 53 not upgraded. After this operation, 116 MB disk space will be freed. Do you want to continue? [Y/n] y (Reading database ... 226155 files and directories currently installed.) Removing ubuntu-server-minimal (1.539.2) ... Removing snapd (2.66.1+24.04) ... Stopping 'snapd.service', but its triggering units are still active: snapd.socket Processing triggers for dbus (1.14.10-4ubuntu4.1) ... Processing triggers for mailcap (3.70+nmu1ubuntu1) ... Processing triggers for man-db (2.12.0-4build2) ... vmuser@ubuntu-vm:~$ vmuser@ubuntu-vm:~$ vmuser@ubuntu-vm:~$ rm -rf ~/snap/ vmuser@ubuntu-vm:~$ vmuser@ubuntu-vm:~$ sudo rm -rf /snap/ vmuser@ubuntu-vm:~$ vmuser@ubuntu-vm:~$ sudo rm -rf /var/cache/snapd/ vmuser@ubuntu-vm:~$ vmuser@ubuntu-vm:~$ sudo rm -rf /var/lib/snapd/ vmuser@ubuntu-vm:~$ vmuser@ubuntu-vm:~$ vmuser@ubuntu-vm:~$ sudo reboot vmuser@ubuntu-vm:~$ vmuser@ubuntu-vm:~$

 

sudo aptitude install ubuntu-gnome-desktop -y

sudo aptitude install gnome-shell-extension-manager
sudo systemctl --user restart gnome-remote-desktop.service
systemctl --user restart gnome-remote-desktop.service

gsettings set org.gnome.desktop.remote-desktop.rdp port 3389
grdctl status
sudo loginctl unlock-sessions

sudo aptitude install language-pack-zh-hans
sudo dpkg-reconfigure locales
cat /etc/default/locale
sudo update-alternatives --config x-session-manager
sudo vi /etc/systemd/sleep.conf 

sudo apt-get autoremove open-vm-tools 
sudo aptitude install open-vm-tools-desktop 
sudo systemctl status udisks2.service

 

================== End

 

 
posted @ 2019-09-20 17:46  lsgxeva  阅读(1501)  评论(0)    收藏  举报