学习自wheeltec机器人资料
首先需要服务端将自己的文件挂载出来,然后才能被客户端访问。
ubuntu端(服务端挂载方法)
sudo apt-get install nfs-kernel-server
sudo gedit /etc/exports
在文末添加一行代码/home/flycar/wheeltec_robot *(rw,sync,no_root_squash)
注意:这里的/home/flycar/wheeltec_robot是你要挂载的文件!!下面的所有都同理
然后给挂载的目录设置权限已经启动和重启NFS服务
sudo chmod -R 777 /home/flycar/wheeltec_robot
sudo /etc/init.d/nfs-kernel-server start
sudo /etc/init.d/nfs-kernel-server restart
然后就是挂载NFS服务
sudo mount -t nfs -o nolock 192.168.0.100:/home/flycar/wheeltec_robot /mnt
df -h
显示红框内内容即为成功
开机执行脚本设置方法
如果每次开机都需要挂载的话就可以设置一个脚本来每次开机就启动
cd /etc/init.d
sudo gedit mount_test.sh
在里面填写内容
#!/bin/bash
### BEGIN INIT INFO
# Provides: svnd.sh
# Required-Start: $local_fs $remote_fs $network $syslog
# Required-Stop: $lcoal_fs $remote_fs $network $syslog
# X-Start-Before: checkroot
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: starts the svnd.sh daemon
# Description: starts svnd.sh using starts-stop-deamon
### END INIT INFO
sudo mount -t nfs -o nolock 192.168.0.100:/home/flycar/wheeltec_robot /mnt
然后运行以下命令
sudo chmod 777 mount_test.sh
sudo update-rc.d mount_test.sh defaults 90
重启电脑尝试df -h
如果如下图即为成功
如果想要取消开机启动就
cd /etc/init.d
sudo update-rc.d -f mount_test.sh remove
配置UBUNTU端发送WIFI
接下来配置UBUNTU端WIFI
```bash
nm-connection-editor
点击左下角加号,设置成为下面三图的样子即可
SSH远程连接
首先要确定两边都安装了ssh,直接尝试下载
sudo apt-get install ssh
windows连接Ubuntu端的WIFI后在windows端虚拟机进行
ping 192.168.0.100
显示如图所示这个延迟时间即为连接成功
接下来
ssh flycar@192.168.0.100
如果显示
cd .ssh
sudo rm -rf known_hosts
ssh flycar@192.168.0.100
然后根据提示输入yes和Ubuntu端密码即可成功登录Ubuntu端终端
设置无密码登录
首先要使得虚拟机跟ubuntu的wifi连接在同一网段上
ssh-keygen
按Enter
y
Enter
Enter即可
出现如图画面即为成功
ssh-copy-id -i .ssh/id_rsa.pub flycar@192.168.0.100
根据提示输入Ubuntu端密码即可
windows虚拟机端修改ubuntu端挂载文件方法
sudo mount -t nfs 192.168.0.100:/home/flycar/wheeltec_robot /mnt
然后你就可以在
红框里看到你挂载的目录内容并修改