vm
Contents
编译环境1
- new vm(vbox)同时连通本机和外网-(两张网卡nat + hostonly)
- 添加新NAT网络
- ip addr
- 修改ip: vi /etc/sysconfig/network-scripts/ifcfg-enp0s3
- GATEWAY=10.0.2.1
- IPADDR=10.0.2.100
- NETMASK=255.255.255.0
- 重启systemctl restart network
- install: jdk,maven https://maven.apache.org/download.cgi
- set maven mirror:
只有一张网卡工作时 修改配置后应用变更
ifconfig -a
sudo netplan apply
- root@kali:
# ifconfig enp0s17 up //启用网卡# ifconfig -a //查看IP
root@kali:
root@kali:~# dhclient enp0s17 // 分配IP
1 | cat /etc/netplan/00-installer-config.yaml |
1 | <mirror> |
编译环境2 multipass
- 安装multipass
- 挂载目录
- multipass set local.privileged-mounts=true
- multipass exec primary mkdir /mnt/e
- multipass mount E:\ primary:/mnt/e
- 修改系统更新源
- sudo cp -a /etc/apt/sources.list /etc/apt/sources.list.bak
- sudo sed -i “s@http://.*archive.ubuntu.com@http://repo.huaweicloud.com@g“ /etc/apt/sources.list
- sudo sed -i “s@http://.*security.ubuntu.com@http://repo.huaweicloud.com@g“ /etc/apt/sources.list
- 安装mvn
- sudo apt-get install maven
- 修改仓库源
vi /usr/share/maven/conf/settings.xml
- 问题
- 空间不足,需要挂载
- 挂载后无法管理权限,脚本无法直接执行
1 | <mirror> |
编译操作
- git clone
- git clone -b 分支名 仓库地址
- git clone -b TAG –depth=1 仓库地址
- git clone -b rel/release-2.8.5 –depth=1 https://gitee.com/apache/hadoop.git
- mvn