搭建Windows10+VMware Ubuntu16.04环境
- VMware添加虚拟机
(1) 双击打开VMware虚拟机,选择“创建新的虚拟机”;
(2) 选择“自定义(高级)”,点击“下一步”;
(3) 默认选项,点击“下一步”;
(4) 选择“稍后安装操作系统”,点击“下一步”;
(5) 选择“Linux”,“Ubuntu 64位”,点击“下一步”;
PS. 如果你下载的是32位的Ubuntu,那么对应的应该选择“Linux”下的“Ubuntu”而不是图片中的选项。
(6) 根据需要更改虚拟机名称及存放位置,点击“下一步”;
(7) 默认选项,点击“下一步”;
(8) 根据需要设置内存大小,注意不要超过实际电脑的内存,点击“下一步”;
(9) 默认选项,点击“下一步”;
(10) 默认选项,点击“下一步”;
(11) 默认选项,点击“下一步”;
(12) 选择“创建新虚拟磁盘”,点击“下一步”;
(13) 根据需要调整最大磁盘大小,可设置大一点,不然Android源码都放不了,选择“将虚拟磁盘存储为单个文件”,点击“下一步”;
(14) 默认选项,点击“下一步”;
(15) 默认选项,点击“完成”。
(16) 到这一步可以看到在虚拟机左侧“我的计算机”一栏中看到刚刚创建的虚拟机,单击虚拟机的名字,单击“编辑虚拟机设置”;
(17) 选中“CD/DVD(SATA)”,选择“使用ISO映像文件”,点击“浏览”,找到前面下载好的虚拟机,点击“确定”。
- 在虚拟机上安装Ubuntu系统
(1) 点击“开启此虚拟机”;
(2) 点击“Install Ubuntu”,可滑动左侧选择安装语言,中文老规矩,最下面;
(3) 勾选“Download updates while installing Ubuntu”,点击“Continue”;
(4) 选择“Erase disk and install Ubuntu”,点击“Install Now”; 在弹出的窗口中选择“Continue”;
PS: 因为我们是新安装的系统,且在虚拟机中,所以可以选择“Erase disk and install Ubuntu”
(5) 点击地图上的中国的位置,会默认弹出上海的时区,因为中国所有地区都是使用同一个时区,所以上海的就OK了。点击“Continue”;
(6) 选择键盘布局,点击“Continue”;
(7) 设置电脑名称和账号密码,点击即可开始安装系统。
(8) 安装完成后会有如下提示,根据提示重启电脑即可。
重启后:
vmware中ubuntu 16.04与windows共享文件夹设置方法
-
在ubuntu中安装Vmware tools
(1) 首先选择虚拟机-》安装vmware tools
弹出vmware tool盘符,界面
(2) 然后在Ubuntu系统中弹出的VMware tools窗口中
找到VMwareTools-9.6.1-1378637.tar.gz
然后我们利用终端,先把WMwareTools拷贝出来
(3) 然后解压VMwareTools-9.6.1-1378637.tar.gz
(4) 解压后, 进入解压后的目录,执行:sudo ./wmware-install.pl
(5) 然后一路回车
In which directory do you want to install the binary files,按回车2.what is the directory that contains the init directories,按回车 3. what is the directory that contains the init scripts,按回车4.In which directory do you want to install the daemon files,按回车5.In which directory do you want to install the library files,按回车6.The path "/usr/lib/vmware-tools" does not ..............................Is this what you want?,按回车7.In which directory do you want to install the document files? 按回车8.The path "/usr/lib/vmware-tools" does not ..............................Is this what you want?,按回车9.Before running VMware tools.............Do you want this program to invokethe command for you now?按回车10.None of the pro-built.......................按回车
(6) 安装完成,重启系统
(7) 安装好vmware-tools之后,/mnt/hgfs目录此时就会出现了。接下来的操作是:
a) sudo apt-get install open-vm-tools-dkms
b) sudo vmhgfs-fuse .host:/ /mnt/hgfs -o allow_other
安装 open-vm-tools-dkms时遇到的问题,以及解决方法
- 首先将/var/lib/apt/lists 的文件备份一下
mkdir /var/lib/apt/list
cp -r /var/lib/apt/lists/* /var/lib/apt/list
然后删除/var/lib/apt/lists/文件夹下所有的文件
sudo rm -rf /var/lib/apt/lists/*
然后 打开/etc/apt/sources.list (emacs/vi/vim都可以用)
将里面的内容都删掉,替换成阿里云的源,因为换了几个源都发现还是会出现index files failed to download的错误
所以我用了网上的几个源组合在一起
#deb包
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
# 更新的源的内容
# deb http://mirrors.aliyun.com/ubuntu/ raring main restricted universe multiverse
# deb http://mirrors.aliyun.com/ubuntu/ raring-security main restricted universe multiverse
# deb http://mirrors.aliyun.com/ubuntu/ raring-updates main restricted universe multiverse
# deb http://mirrors.aliyun.com/ubuntu/ raring-proposed main restricted universe multiverse
# deb http://mirrors.aliyun.com/ubuntu/ raring-backports main restricted universe multiverse
# deb-src http://mirrors.aliyun.com/ubuntu/ raring main restricted universe multiverse
# deb-src http://mirrors.aliyun.com/ubuntu/ raring-security main restricted universe multiverse
# deb-src http://mirrors.aliyun.com/ubuntu/ raring-updates main restricted universe multiverse
# deb-src http://mirrors.aliyun.com/ubuntu/ raring-proposed main restricted universe multiverse
# deb-src http://mirrors.aliyun.com/ubuntu/ raring-backports main restricted universe multiverse
先复制好内容
vi linux命令行用d键删除行,用滚轮中键或shift+Insert来粘贴内容
- 重新配置DNS;
sudo emacs/vi /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 114.114.114.114
naemserver 8.8.8.8
#阿里的DNS
nameserver 223.5.5.5
nameserver 223.6.6.6
-
网上看见将那些第三方的软件更新全部勾去
- 之后再运行sudo apt-get update 和 sudo apt-get upgrade
- 成功后再操作
sudo apt-get install open-vm-tools-dkms
搭建编译环境
- 下载源码
- install OpenJDK8
(1)
sudo apt-get update
sudo apt-get install openjdk-8-jdk
(2). 配置环境变量
sudo gedit /etc/profile
在打开的文本后面添加一下代码:
export JAVA_HOME=/usr/lib/jvm/java-7-openjdk-amd64
export JRE_HOME={JAVA_HOME}/lib:{JAVA_HOME}/bin:$PATH
(3). 验证是否成功
保存后,关闭文本,回到终端输入执行
source /etc/profile
然后在随意个盘符创建个HelloWord.java文件来测试是否安装jdk成功
public class HelloWord {
public static void main(String[] args){
System.out.println("helloword");
}
}
然后在终端输入:cd /media/用户名/分区
javac HelloWord.java 就会在/分区盘符生成HellWord.class文件
java HelloWord 如在终端显示helloword则安装jdk成功!
- 编译Android7.0
搭建构建环境 - 等16G内存到了,开始build,预祝成功
Ref
VMware中Ubuntu 出现Unknown Display问题解决
https://blog.csdn.net/zhanghaoyangchao/article/details/80835451
https://jingyan.baidu.com/article/066074d6374916c3c21cb016.html
https://blog.csdn.net/junexue1980/article/details/83021635
https://blog.csdn.net/flyingcys/article/details/63686254
更新源问题
安装 openJava7.0