virtualbox ubuntu 装机完后的基本配置
前言:ubuntu 系统安装请看另外一篇文章。本文只讲基础系统配置。
(一)
配置root密码:
sudo passwd root
(二)
网络配置
1.0 下面配置前请确保ssh dns等已经安装。否则/etc/network/interfaces 按原配置。才能(网络地址转换NAT)通过宿主机联网。
sudo apt-get install bind9
sudo apt-get install openssh-server //开通SSH服务, 然后ssh工具可以连接。
1.1 vi /etc/network/interfaces
# This file describes the network interfaces available on your system # and how to activate them. For more information, see interfaces(5). # The loopback network interface #auto lo #face lo inet loopback # The primary network interface auto eth0 iface eth0 inet static address 192.168.2.160 gateway 192.168.2.1 netmask 255.255.255.0
1.2 dns配置
cat /etc/resolv.conf # Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8) # DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN nameserver 202.96.128.166 nameserver 202.96.134.133 nameserver 8.8.8.8
注意:这里这个文件是临时生成的。要重启仍然生效需要:
sudo vim /etc/resolvconf/resolv.conf.d/base
nameserver 202.96.128.166 nameserver 202.96.134.133 nameserver 8.8.8.8
1.3 ping www.baidu.com 检测网络是否ok.
1.4 sudo apt-get update
如果执行失败:请:rm -rf /var/lib/apt/lists/partial/ 然后再执行:apt-get update
1.5 这里有可能宿主机的ssh还无法和虚拟机的ubuntu建立连接。请关机ubuntu(未关机情况下是灰色的。无法enable两张网卡。)。将网卡1 网卡2都enable。
网卡1 桥接
网卡2 host only
OK, 这样应该可以连接上了。
三 安装git
sudo apt-get install git
修改完之后保存,然后执行resolvconf -u
sudo apt-get install bind9 libc6:i386 libncurses5:i386 libncurses5-dev libstdc++6:i386 zlib1g:i386 samba samba-common nfs-kernel-server openssh-client openssh-server git vim libssl-dev gcc-multilib build-essential xutils xutils-dev daemon libtalloc2 dos2unix m4 cutecom minicom
sudo apt-get install nfs-kernel-server
service portmap start
sudo /etc/init.d/nfs-kernel-server restart
sudo vi /etc/exports
sudo pip install pycryptodomex
sudo apt-get upgrade
sudo apt-get install u-boot-tools
sudo apt-get install repo
sudo apt install python-pip
sudo pip install --upgrade pip
sudo apt-get install lzma uuid sqlite3 tcl tk