virtualbox安装ubuntu

1 发现没有安装ssh,使用apt-get install openssh-server安装ssh, 安装好后,执行/etc/init.d/ssh resart启动ssh

2 安装增强保

  1. 安装编译环境,执行如下命令

    sudo apt-get install build-essential

  2. 映射设备

    sudo mount /dev/cdrom /media/cdrom

  3. 进入cd /media/cdrom
  4. 执行sudo ./VBoxLinuxAdditions-x86.run
  5. 完成后重启

3 替换国内源
换成国内最快的阿里云源

第一步:备份原来的源文件
cd /etc/apt/
然后会显示下面的源文件sources.list
输入命令
sudo cp sources.list sources.list.bak
就是将sources.list备份到sources.list.bak

第二步:替换源
阿里云源的文件

deb http://mirrors.aliyun.com/ubuntu/ xenial main restricted universe multiverse  
deb http://mirrors.aliyun.com/ubuntu/ xenial-security main restricted universe multiverse  
deb http://mirrors.aliyun.com/ubuntu/ xenial-updates main restricted universe multiverse  
deb http://mirrors.aliyun.com/ubuntu/ xenial-backports main restricted universe multiverse  
##测试版源  
deb http://mirrors.aliyun.com/ubuntu/ xenial-proposed main restricted universe multiverse  
# 源码  
deb-src http://mirrors.aliyun.com/ubuntu/ xenial main restricted universe multiverse  
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-security main restricted universe multiverse  
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-updates main restricted universe multiverse  
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-backports main restricted universe multiverse  
##测试版源  
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-proposed main restricted universe multiverse  
# Canonical 合作伙伴和附加  
deb http://archive.canonical.com/ubuntu/ xenial partner  
deb http://extras.ubuntu.com/ubuntu/ xenial main  

替换并保存
sudo gedit sources.list打开文件,替换成阿里云文件即可

第三步:更新源和软件
sudo apt-get update 更新源
sudo apt-get upgrade 更新软件

4 与宿主机共享文件夹权限问题 sudo adduser 当前用户名 vboxsf

5 虚拟机扩容
VBoxManage showhdinfo ubuntu-my-dev.vdi
计算要扩容的空间大小,我这里是要扩展到10G(102410241024*10)
VBoxManage modifymedium Ubuntu-my-dev.vdi --resizebyte 1073741824

6 开机启动 在/etc/rc.local中添加启动内容

补充nginx配置lua资料 https://www.jianshu.com/p/630fd428c950
https://www.cnblogs.com/zhaoyingjie/p/6840616.html
deb http://_cz.archive.ubuntu.com... disco main universe

你可能感兴趣的:(virtualbox,ubuntu)