●1 问题:使用virt-manager创建虚拟机时,Virtual network 'default':NAT(Inactive)

解决方法:
1,查看网络状态
sudo virsh net-list --all
2,如果自动开始为no,做如下设定。
sudo virsh net-autostart default
3,起动网络
sudo virsh net-start default

●如果又出现如下错误:
internal error: Network is already in use by interface virbr0
解决方法:
Identify the name of the bridge associated with the 'default' network.

You can find out the bridge name in the default network template (/etc/libvirt/qemu/networks/default.xml).

In most cases, the bridge name is virbr0.

Remove that bridge as follows.

$ sudo  ifconfig  virbr0  down

$ sudo brctl delbr virbr0(Note: not necessary)
Now start the 'default' network using virsh command.

$ sudo virsh net-start default
This will automatically re-create the virbr0 bridge.

再次确认网络状态:
$ sudo virsh net-list --all
参考:
http://blog.csdn.net/liukuan73/article/details/43238955
http://ask.xmodulo.com/network-default-is-not-active.html

●2 ubuntu代理上网
方法1:
仅仅让apt-get使用http代理(仅当前有效)。
执行:exporthttp_proxy="http://用户名:密码@代理IP:代理端口"

方法2:
仅仅让apt-get一直使用http代理。
sudo gedit /etc/apt/apt.conf
在apt.conf文件加入:
Acquire::http::Proxy "http://yourproxyaddress:proxyport/".

方法3:
在主目录的.bashrc文件中添加两行(都能使用代理)。
sudo vi ~/.bashrc

http_proxy=http://yourproxyaddress:proxyport
export http_proxy

●3 Ubuntu 网卡配置

自ubuntu 15之后,网卡名称不叫eth0了(现在为ensXX),可以通过ifconfig -a 查看。

※当然还可以把网卡名称改回eth0,不过认为没有必要。

如果执行命令:ifconfig 只显示 lo,不显示网卡。

可以通过编辑/etc/network/interfaces文件,追加以下语句:

auto lo
iface lo inet loopback
在后面添加内容:

#两种方法任选一个
#1、获取动态配置:
auto eth0
iface eth0 inet dhcp
#2、获取静态配置:
auto eth0
iface eth0 inet static
address 192.168.0.2
netmask 255.255.255.0
gateway 192.168.0.1

dns-nameservers 192.168.0.1

●备注
修改/etc/network/interfaces这个文件,配置IP、网关。里面有个参数DNS,对应的参数名为dns-nameservers,
这里设置的优先级比resolv.conf高,也就是网络会从这里读取DNS配置,如果没配置才去看resolv.conf里面的设置,
因此在这里面配置DNS更简单。

配置完成后,重启网络:
sudo service networking restart
或者
sudo /etc/init.d/networking restart

也可以重启网卡:
sudo ifconfig eth0 down
sudo ifconfig eth0 up
重启网卡对别的网卡无影响。

GUI版配置如下:

●4,Ubuntu默认不允许root通过ssh直接登录,设置如下(允许root登录):
编辑vim /etc/ssh/sshd_config文件,将PermitRootLogin 的值改为yes。
如下所示:
# Authentication:
LoginGraceTime 120
PermitRootLogin yes
StrictModes yes
 
●5,以下命令确认CPU支持虚拟化。
euser01@ubuntu:~$ egrep -o '(vmx|svm)' /proc/cpuinfo
显示结果:vmx
          vmx

●6,主机名称配置文件(/bin/hostname)

▪查看当前主机的主机名称:

sudo /bin/hostname

▪设置当前主机的主机名称:

sudo /bin/hostname newname

系统启动时从/etc/hostname来读取主机的名称.

ubuntu 常用设置的更多相关文章

  1. x01.os.22: ubuntu 常用设置

    新组装了个 64 位电脑,i5 CPU,进入 ubuntu 后,又是一通搜索设置,整理如下,以备后用. 安装 .dep 包 sudo dpkg -i [filename.dep] 在 ubuntu 中 ...

  2. Ubuntu 16.04修改MAC地址以及网络常用设置(IP/DNS/网关)

    1.先停止桌面版自带的NetworkManager,这东西很难用,且有些设置需要重启. sudo systemctl stop NetworkManager.service sudo systemct ...

  3. Ubuntu常用命令大全(转)

    点评:Ubuntu常用命令大全,学习ubuntn系统的朋友可以收藏下,用ctrl+F查找即可 一.文件/文件夹管理 ls 列出当前目录文件(不包括隐含文件) ls -a 列出当前目录文件(包括隐含文件 ...

  4. Ubuntu常用200条命令

       查看软件xxx安装内容:dpkg -L xxx 查找软件库中的软件:apt-cache search 正则表达式 查找软件库中的软件:aptitude search 软件包 查找文件属于哪个包: ...

  5. 解决Qt中文乱码以及汉字编码的问题(UTF-8/GBK)——ubuntu环境设置默认是utf-8,文件编码可使用Encodersoft批量转换

    一.Qt环境设置 文件从window上传到Ubuntu后会显示乱码,原因是因为ubuntu环境设置默认是utf-8,Windows默认都是GBK.Windows环境下,Qt Creator,菜单-&g ...

  6. 【转】Ubuntu常用软件合集

    [转]Ubuntu常用软件合集 Ubuntu常用软件合集 我用的使Ubuntu-Kylin14.04,原因呢主要是觉得使本土化的,自带了日历.输入法.优客助手等易于上手的应用.也省的每次安装完原生的系 ...

  7. linux云服务器常用设置

    前面的话 由于在云服务器上配置自己的网站,将Linux里的常用设置记录如下 更改shell 默认地, ubuntu系统默认的shell是dash,但更常用的shell是bash 通过下面命令可以将da ...

  8. ubuntu下设置jupyter notebook 2017年07月29日 19:28:34 小旋锋 阅读数:8329 标签: ubuntu 更多 个人分类: python 二三事 来源:http://blog.csdn.net/suzyu12345/article/details/51037905 Ipython Notebook现在已经改名为Ipython jupyter,是最知名最好用的

    ubuntu下设置jupyter notebook     来源:http://blog.csdn.net/suzyu12345/article/details/51037905 Ipython No ...

  9. Ubuntu常用命令大全[显示桌面]

    Ubuntu常用命令大全 查看软件xxx安装内容 #dpkg -L xxx 查找软件 #apt-cache search 正则表达式 查找文件属于哪个包 #dpkg -S filename apt-f ...

随机推荐

  1. 019-centos的yum用法

    1.检测系统是否已经安装过mysql或其依赖:# yum list installed | grep mysql(当然也可以用 rpm -qa | grep mysql) 2.卸载已经存在的mysql ...

  2. javascript 判断数据类型

    Object.prototype.toString.call(asddfff) //报错asddfff没被定义Object.prototype.toString.call(undefined) //& ...

  3. 20154312《网络对抗》Exp2 后门原理与实践

    常见问题快速链接 Handler failed to bind to xxx.xxx.xx.xxx:xxxx 使用Webcam_snap命令提示1411错误,无法正常拍照 常用后门工具实践 Windo ...

  4. Python: ord()函数

    ch() , unichr() , ord() ①chr()函数用一个范围在range(256)内的整数作参数,返回一个对应的字符. >>>chr(65) 'A' ②unichr() ...

  5. MAVEN打包丢失xml文件解决办法

    MAVEN打包默认只包含src/main/java下的class文件,如果需要包含xml.properties等文件,请在build节点下面添加如下代码 <resources> <r ...

  6. Hive 常用语句(持续更新中)

    1)按包含关键字在指定库中查找表名:show tables in dw '*_fab_*';   2)查看和删除自己hdfs系统所用的空间和文件(与shell命令合用):hive命令行下: --查看仓 ...

  7. centos7.3安装redis

    yum install epel-release yum install redis 如果支持从其他机器能访问,需要修改配置文件 /etc/redis.conf,注释掉 bin 127.0.0.1 如 ...

  8. python之路----模块调用

    如何使用模块? 1 import 示例文件:自定义模块my_module.py,文件名my_module.py,模块名my_module #my_module.py print('from the m ...

  9. IDEA上传代码到码云

  10. ES6学习--对象属性的可枚举性( enumerable)

    可枚举性(enumerable)用来控制所描述的属性,是否将被包括在for...in循环之中.具体来说,如果一个属性的enumerable为false,下面三个操作不会取到该属性.* for..in循 ...