ubuntu 基于windows
windows10下的ubuntu子系统
wsl windows server linux
ubuntu在微软商店可下载,安装好之后配置一个用户名和密码,默认的root用户时没有密码的。需要使用root用户 使用passwd root来就行修改
使用xshell来连接本机ubuntu
ubuntu端进行配置:
cd /etc/ssh #切换到ssh配置文件的位置
sudo cp sshd_config sshd_config.bak #先把原来的备份
sudo vim sshd_config #编辑配置文件
在文件中做更改
Port 3652 #修改端口,原来的22端口已经存在
ListenAddress 0.0.0.0 #打开本地监听
#StrictModes yes #注释掉
PasswordAuthentication yes #修改登陆的方式,允许密码登陆
重启ssh
sudo service ssh restart
重新生成host key
sudp dpkg-reconfigure openssh-server
由于是wsl的ubuntu,使用ifconfig查找lo的ip值,就是127.0.0.1
使用xshell连接,127.0.0.1即可
在windows关机后重启开启ubuntu只会启动一个用户的bash,没有其他的服务启动,要想使用xshell连接,可以修改 .bashrc 文件 ,把 service ssh start 加进去,切换root用户的同时就启动了ssh,关掉windows的shell,就可以用xshell连接了
修改默认源
cd /etc/apt/
cp sources.list ./sources.list.bak
vim sources.list
deb http://mirrors.aliyun.com/ubuntu/ trusty main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ trusty-security main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ trusty-updates main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ trusty-proposed main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ trusty-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ trusty main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ trusty-security main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ trusty-updates main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ trusty-proposed main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ trusty-backports main restricted universe multiverse
更新源
sudo apt-get update
更新软件
sudo apt-get upgrade
文件系统挂载点
ubuntu系统在windows的%localappdata%\Packages\CanonicalGroupLimited.UbuntuonWindows_79rhkp1fndgsc\LocalState\rootfs 文件夹下
windows系统在wsl中的路径都是挂载在/mnt下面

装py3
apt install python3
装pip3
apt-get install python3-pip
安装的时候报错 [ImportError: cannot import name 'sysconfig']
解决:https://blog.csdn.net/weixin_41282397/article/details/85068590
安装过程很耗时的
开启xshell之后,每执行一条命令,都会在在windows的任务管理器中开启一个bash sudo这样的进程,关掉xsehll,进程就都掉
ubuntu子系统在任务管理器中的进程为 init
虚拟环境的建立
1 安装包
sudo apt install python-virtualenv
sudo easy_install virtualenvwrapper
virtualenvwrapper依赖于 python virtualenv,安装的顺序不能颠倒
或者使用pip进行安装,两种方式都是一样的
sudo pip install virtualenv
sudo pip install virtualenvwrapper
安装完成之后可能没有mkvirtualenv命令,一般是脚本文件没有加入系统路径
# 找到virtualenvwrapper的脚本文件
whereis virtualenvwrapper
# 执行脚本文件激活virtualenvwrapper
source virtualenvwrapper.sh
# 可以正常使用命令了
或者将sourc加到用户的环境配置文件中
sudo vi ~/.bashrc
source xxx/virtualenvwrapper.sh的绝对路径
更新文件
source ~/.bashrc
创建虚拟环境
mkvirtualenv 环境名称 -p 指定python版本
进入环境
workon
退出环境
deactivate
然后就可以在虚拟环境中安装需要的包了
文件传输
由于ubuntu作为windows的一个子系统,所以ip是同一个,所以就不在用pycharm的文件同步功能了,直接在ubuntu中访问 /mnt下的各盘,找到工作目录就可以执行操作了
mysql 数据库
apt-get install mysql-server
启动
service mysql start
默认没密码就能登录,上去更改密码
select mysql;
update user set authentication_string=password('123456') where user='root';
redis
安装Redis服务器端
sudo apt-get install redis-server
启动
service redis-server start
zabbix
wget https://repo.zabbix.com/zabbix/4.0/ubuntu/pool/main/z/zabbix-release/zabbix-release_4.0-2+bionic_all.deb
dpkg -i zabbix-release_4.0-2+bionic_all.deb
apt update
apt install zabbix-server-mysql
apt install zabbix-frontend-php
zcat /usr/share/doc/create.sql.gz |mysql -mzabbix -pzabbix
安装完成之后再刚进入zabbix界面的时候出现时区错误问题,需要修改两个文件,再重启zabbix 跟 apache2
vim /etc/php/7.2/apache2/php.ini

vim /etc/apache2/conf-available/zabbix.conf

ubuntu 基于windows的更多相关文章
- Ubuntu登录Windows Server 2008r2 密码总是错误与NLA验证
日期:2013-05-22 经过一天的折腾,终于能够用Ubuntu登录Windows server 2008 R2 了. 寝室里面用小本子,装的ubuntu,实验室的服务器是win server0 ...
- 通过 xshell 连接 ubuntu on windows(WSL)
装上 ubuntu on windows 后,默认要先打开 cmd, 再运行 bash 进入 ubuntu 的 shell. 但是这个shell很难看,配色不好就算了,还存在各种复制粘贴麻烦. 默认没 ...
- Bash on Ubuntu on Windows ( Windows Subsystem for Linux)
1 # Bash on ubuntu on Windows http://www.cnblogs.com/anonymous-ufo/p/6143480.html 1 1 如何启用Bash on u ...
- 为什么基于Windows Server 2008 R2的网络负载均衡(NLB)配置的时候总会报错“主机不可访问”?
配置基于Windows的网络负载均衡是很容易的,操作也很简单,点点鼠标基本上就能完成,但是在进行节点(真实服务器)操作的过程中有时候会遇到一些主机不可访问的报错信息.这个又是为什么呢? Figure ...
- Wizard Framework:一个自己开发的基于Windows Forms的向导开发框架
最近因项目需要,我自己设计开发了一个基于Windows Forms的向导开发框架,目前我已经将其开源,并发布了一个NuGet安装包.比较囧的一件事是,当我发布了NuGet安装包以后,发现原来已经有一个 ...
- 如何为基于windows验证的站点的某个页面、文件或文件夹单独设置匿名访问
在MOSS的项目中,我们经常碰到要单独为基于windows验证的站点的某个页面.文件或文件夹单独设置匿名访问即不登录就可以直接访问.比如说站点的A的某些图片或文件URL存在B站点下的文件夹下.此时访问 ...
- VC中基于 Windows 的精确定时[转]
在工业生产控制系统中,有许多需要定时完成的操作,如定时显示当前时间,定时刷新屏幕上的进度条,上位 机定时向下位机发送命令和传送数据等.特别是在对控制性能要求较高的实时控制系统和数据采集系统中,就更需要 ...
- 如何使用新浪微博账户进行应用登录验证(基于Windows Azure Mobile Service 集成登录验证)
使用三方账号登录应用应该对大家来说已经不是什么新鲜事儿了,但是今天为什么还要在这里跟大家聊这个话题呢,原因很简单 Windows Azure Mobiles Service Authenticatio ...
- remote desktop connect btw Mac, Windows, Linux(Ubuntu) Mac,Windows,Linux之间的远程桌面连接
目录 I. 预备 II. Mac连接Windows III. Windows连接Mac IV. Windows连接Ubuntu V. Mac连接Ubuntu VI. Ubuntu连接Mac VII, ...
随机推荐
- 客开监控(BE/UI/BP)插件停用与启用
1.单据界面右键属性,获取当前客开监控页面URL连接:http://172.16.168.15/U9/erp/display.aspx?lnk=UFSoft.UBF.Cust.CustManager& ...
- 已拦截跨源请求:同源策略禁止读取位于XXX的远程资源。(原因:CORS 头缺少 'Access-Control-Allow-Origin'
vue+springboot项目 前端发送请求微信 URL:http:/.........(企业微信的路径) 请求成功,数据发送过去可以接收到,处理完毕后发送返回值给我 我这边前端网络响应处可以看到返 ...
- 软件测试人员必备的Python知识图库
UI自动化测试(Python+Selenium等) 接口测试(Python requests等) 性能测试(Python Locust等) 安全性测试(Python Scapy等) 兼容性测试(Pyt ...
- 全栈项目|小书架|微信小程序-点赞功能实现
微信小程序端的点赞功能其实没什么好介绍的,无非就是调用接口改变点赞状态和点赞数量.需要注意的是取消点赞时的处理,我这里为了减少服务器接口的调用,直接本地存一个变量,修改这里的变量值即可. 由于源码都相 ...
- yii框架中的下拉菜单和单选框
yii中的下拉菜单: 第一种: <?= $form->field($model, 'parent_id')->dropDownList(ArrayHelper::map($data, ...
- 阿里巴巴 Java 开发手册(三): 代码格式
1. [强制]大括号的使用约定.如果是大括号内为空,则简洁地写成{}即可,不需要换行:如果 是非空代码块则: 1) 左大括号前不换行. 2) 左大括号后换行. 3) 右大括号前换行. 4) 右大括号后 ...
- 2019年Amazon AWS-Solutions-Architect-Professional考试最新题库(AWS SAP题库)带考试模拟器
大家好,由于最近自己备考Amazon AWS-Solutions-Architect-Professional考试,购买了以下链接的题库,并通过了考试 https://www.kaoguti.gq/A ...
- 拓展 - Webrtc 的回声抵消(aec、aecm)算法简介
webrtc 的回声抵消(aec.aecm)算法简介 原文链接:丢失.不好意思 webrtc 的回声抵消(aec.aecm)算法主要包括以下几个重要模块:1.回声时延估计 2.NLMS( ...
- 【转载】 C#中List集合使用OrderByDescending方法对集合进行倒序排序
在C#的List集合操作中,有时候需要针对List集合进行排序操作,如果是对List集合按照元素对象或者元素对象的某个属性进行倒序排序的话,可以使用OrderByDescending方法来实现,Ord ...
- JavaScript之控制标签属性
var pic=document.getElementById('pic'); var obtn=document.getElementById('btn'); console.log(pic.get ...