由于在虛拟機上安裝ubuntu,為了減輕系統負載,隻使用進入字元界面,在本地ssh連接配接操作
修改顯示語言
修改預設進入界面
- ubuntu 18_04
sudo systemctl set-default multi-user.target #預設進入字元界面
sudo systemctl set-default graphical.target #預設進入圖形界面
sudo init 5
startx
- ubuntu 14_04
update-grub2
設定固定ip
here
[email protected]:~# vim /etc/network/interfaces
1 # interfaces(5) file used by ifup(8) and ifdown(8)
2 auto lo
3 iface lo inet loopback
4
5
6 iface eth0 inet static
7 address 192.168.3.129
8 netmask 255.255.255.0
9 gateway 192.168.3.1
ubuntu18的固定ip設定https://blog.csdn.net/u010039418/article/details/80934346
yaml配置檔案
[email protected]:~$ vim /etc/netplan/01-network-manager-all.yaml
# Let NetworkManager manage all devices on this system
network:
version: 2 #注意縮進問題
#renderer: NetworkManager
ethernets:
ens33:
addresses: [192.168.3.129/24]
gateway4: 192.168.3.1
nameservers:
addresses: [219.141.136.10]
更改dns域名伺服器位址
[[email protected] ~]$sudo vim /etc/resolvconf/resolv.conf.d/base
1 nameserver 219.141.136.10
[[email protected] ~]$service resolvconf restart #重新開機服務
stop: Rejected send message, 1 matched rules; type="method_call", sender=":1.27" (uid=1000 pid=2350 comm="stop resolvconf ") interface="com.ubuntu.Upstart0_6.Job" member="Stop" error name="(unset)" requested_reply="0" destination="com.ubuntu.Upstart" (uid=0 pid=1 comm="/sbin/init")
start: Rejected send message, 1 matched rules; type="method_call", sender=":1.28" (uid=1000 pid=2344 comm="start resolvconf ") interface="com.ubuntu.Upstart0_6.Job" member="Start" error name="(unset)" requested_reply="0" destination="com.ubuntu.Upstart" (uid=0 pid=1 comm="/sbin/init")
[[email protected] ~]$ping www.baidu.com #可以ping通baidu
PING www.a.shifen.com (182.61.200.7) 56(84) bytes of data.
64 bytes from 182.61.200.7: icmp_seq=1 ttl=51 time=27.9 ms
64 bytes from 182.61.200.7: icmp_seq=2 ttl=51 time=21.6 ms
^C
--- www.a.shifen.com ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 1006ms
rtt min/avg/max/mdev = 21.693/24.817/27.942/3.128 ms
/etc/resolv.conf
下有這樣的提示
“DO NOT EDIT THIS FILE BY HAND – YOUR CHANGES WILL BE OVERWRITTEN”,這裡直接編輯會當時生效,但是重新開機後會重置。所能需像依上面來進行設定,或者直接寫入固定ip配置中-> here。