1、关闭防火墙
ufw disable
2、安装nfs
sudo apt-get install nfs-kernel-server
3、
打开/etc/exports文件,在末尾加入: /home/hi3519a/Hi3519AV100_SDK_V2.0.2.0/osdrv/rootfs_scripts/rootfs *(rw,no_root_squash,no_all_squash,sync)
注释:/home/hi3519a/Hi3519AV100_SDK_V2.0.2.0/osdrv/rootfs_scripts/rootfs是需要共享的目录
4、重启服务
#sudo /etc/init.d/nfs-kernel-server restart //重启nfs服务 #showmount -e //显示共享出的目录
5、本地测试
sudo mount -t nfs 172.16.10.112:/home/hi3519a/Hi3519AV100_SDK_V2.0.2.0/osdrv/rootfs_scripts/rootfs /home/mnt
172.16.10.112 为本机虚拟机IP地址,这样就把rootfs目录挂到了本地/home/mnt目录
5、开发板挂载,在串口调试工具中运行
mount -t nfs 172.16.10.112:/home/hi3519a/Hi3519AV100_SDK_V2.0.2.0/osdrv/rootfs_scripts/rootfs /root/nfsroot -o nolock
6、取消挂载
sudo umount /home/mnt
注意:将虚拟机ip、win10 ip和板子的ip设成同一个网段。挂载的目录要统一,主机和板子网线插好
在虚拟机里, VMware 虚拟网卡设置为 NAT 模式的话, Linux 系统网卡设置为动态 IP
即可;如果虚拟网卡设置为桥接模式,则需要为 Linux 设置一个与 Windows 系统同一个网
段的静态 IP 地址。
在 Linux 主机输入下面命令安装 ssh 服务器:
sudo apt-get install openssh-server
ifconfig命令查看ip
1、直接修改系统配置文件
ubuntu的网络配置文件是:/etc/network/interfaces
a、动态ip方式
auto eth0 //eth0修改自己的
iface eth0 inet dhcp
用下面的命令使网络设置生效:
sudo /etc/init.d/networking restart
b、静态ip方式
auto eth0
iface eth0 inet
static
address 192.168.1.22
gateway 192.168.1.1
netmask 255.255.255.0
#network 192.168.1.0
#broadcast 192.168.1.255
将上面的ip地址等信息换成你自己就可以了.用下面的命令使网络设置生效:
sudo /etc/init.d/networking restart
win系统ping虚拟机ip看看能否通