ubuntu虚拟机与evm3730开发版的开发环境搭建过程

1、安装usb转串口驱动,将开发板通过串口线连接到xp系统电脑上。

2、安装zoc串口工具,打开zoc软件进入options-->Jump to --> devices中的serial/modem 选项

设置

 

 

遇到的问题:

1、板子没连上电脑

原因一:用usb转串口的串口线才能连上...不知道为什么?

原因二:串口通信软件的设置如波特率等一定要设置正确。

原因三:要先开启软件并且在监听状态的时候再接通开发板电源。

原因四:可能由于出动了串口线的原因,导致串口软件接通后显示一小段乱码。可以尝试拔掉串口线关掉软件、再重新连接上。

原因五:系统启动顺序的问题,原来的拔码开关设置为111000,启动时优先从mmc内存卡启动。而后来设置成nandflash启动后(111100),马上就能启动了。感觉应该是内存卡启动不太稳定导致了经常性板子死机后启动不了。

2、板子连接到虚拟机ubuntu(没必要)

需要注意的事:安装minicom和设置serial port 为ttyUSB0(这是usb转串口的端口) 如果是单纯的串口则应该是ttyS0~3中的一个.

3、板子与虚拟机的linux系统之间不能ping通。

原因一:虚拟机设置的NAT连接方式是不行的。应该使用桥接的方式(这时候虚拟机中的系统相当于一台独立的机器)。

原因二:使用桥接的时候vnet0为桥接方式,并且设置里面的网卡选项并不是网络上的真实网卡而是选择了自动。

原因三:在ubuntu中设置了ip网段后如果连接还没有显示连通的话,则重启计算机。想要ping通,首先虚拟机得与主机是联通的。

原因四:插上usb摄像头之后windows的网络连接中多了一个本地连接2,在虚拟机的桥接设置中的Automatic选项中去掉这个本地连接2.然后重新进入ubuntu就能ping通开发板了。

4、nfs文件共享的问题。

 开始出现超时的问题:解决办法 把exports 中的 /home/worknfs  192.168.1.*(rw,sync,no_root_squash) 中的192.168.1.去掉就能连接了。

 

 

http://forum.ubuntu.org.cn/viewtopic.php?t=73101

Ubuntu上nfs的安装配置
04Ubuntu 默认是没有nfs服务的,所以需要自己安装

1、安装nfs服务版
apt-get install nfs-kernel-server
2、修改nsf配置文件
vi /etc/exports
在文件中添加nfs的目录格式如下
/home/worknfs  *(rw,sync,no_root_squash)
存盘退出
3、在根目录下建立nsf的目录
mkdir /home/worknfs
修改该目录的权限
chmod 777 -R /home/worknfs
4、从新启动nfs
/etc/init.d/nfs-kernel-server restart

5、测试nsf

mount 192.168.1.101:/home/worknfs
嵌入式要mount 的时候 使用

mount -o nolock 192.168.1.101:/home/worknfs /mnt/nfs
 
*****一下我没用到...转载别人的*********

注:在内核的配置里面的

Networking options --->选项中

启用 TCP/IP networking

启用IP: kernel level autoconfiguration

General setup ---> 选项中 ,

Default kernel command string: (默认的内核命令行)

加入绿色字中的字符

root=/dev/nfs rw nfsroot=192.168.1.99:/armnfs/ ip=192.168.1.201 init=/linuxrc console=ttyS0

File system ---> Network File System --->选项

启用 NFS file system support

启用 Provide NFSv3 client support

启用 Root file system on NFS


nfs配置:
less /etc/exports
/home/xx/ 192.168.0.*(rw,sync)

$ sudo /etc/init.d/portmap start
* Starting portmap daemon...
* Already running. [ OK ]
$sudo /etc/init.d/nfs-common start
* Starting NFS common utilities [ OK ]
$ sudo /etc/init.d/nfs-kernel-server start
* Exporting directories for NFS kernel daemon...
exportfs: /etc/exports [2]: Neither 'subtree_check' or 'no_subtree_check' specified for export "192.168.0.*:/home/xx/".
Assuming default behaviour ('subtree_check').
NOTE: this default will change with nfs-utils version 1.1.0
[ OK ]
* Starting NFS kernel daemon [ OK ]

$ showmount -e
Export list for Qunhome:
/home/xx 192.168.0.*


似乎都好了,可是 :
sudo mount 192.168.0.100:/home/xx /mnt
mount: 192.168.0.100:/home/xx failed, reason given by server: Permission denied



我装的是7.04,和你出现了同样的问题,以前我用6.06的时候是没有问题的
不知道是不是7.04的bug阿,
配置portmap的时候,在etc目录下就没有找到host.allow和hosts.deny这俩个文件,我是自己新建的这俩个文件,以前我记得在etc目录下是有的。

在/etc/exports下写入你的IP地址,不要有*号。例如:(/home/zwg IP(rw,sync,no_root_squash))
原因可能是etc目录下没有hosts.allow和hosts.deny这俩个文件。

我装的是7.04,和你出现了同样的问题,以前我用6.06的时候是没有问题的
不知道是不是7.04的bug阿,
配置portmap的时候,在etc目录下就没有找到host.allow和hosts.deny这俩个文件,我是自己新建的这俩个文件,以前我记得在etc目录下是有的。

非常感谢!
我删除了安装文件和所有相关配置文件
然后一步步重新来,最后成功了

做的改动为:
在/etc/hosts中用IP lists 代替 *

还有一种方法:安装配置的没有大问题。不妨在括号里加上no_subtree_check选项,这是减少文件共享访问检查的,如果你的共享目录在本地没有很多读写请求的话(man exports)。

On the master node, edit your /etc/hosts.allow file to allow connections from slave nodes. If your cluster LAN is on 192.168.1.0/24, your hosts.allow will look like:

Code Listing 2.10: hosts.allow

portmap:192.168.1.0/255.255.255.0

Edit the /etc/exports file of the master node to export a work directory structure (/home is good for this).

Code Listing 2.11: /etc/exports

/home/ *(rw)

把hosts.deny删除。子网用掩码的方法表示。


NFS(Network File System, 网络文件系统)可以通过网络将分享不同主机(不同的OS)的目录——可以通过NFS挂载远程主机的目录, 访问该目录就像访问本地目录一样!
一般而言, 使用nfs能够方便地使各unix-like系统之间实现共享. 但如果需要在unix-like和windows系统之间共享, 就得使用samba了!
NFS运行在SUN的RPC(Remote Procedure Call, 远程过程调用)基础上, RPC定义了一种与系统无关的方法来实现进程间通信. 由此, NFS server也可以看作是RPC server.

正因为NFS是一个RPC服务程序, 所以在使用它之前, 先要映射好端口——通过portmap设定. 比如: 某个NFS client发起NFS服务请求时, 它需要先得到一个端口(port). 所以它先通过portmap得到port number. (不仅NFS, 所有的RPC服务程序启动之前, 都需要设定好portmap)
与NFS相关的几个文件, 命令
1, /etc/exports
对NFS卷的访问是由exports来批准, 它枚举了若干有权访问NFS服务器上文件系统的主机名.

2, /sbin/exportfs
维护NFS的资源共享. 可以通过它重新设定 /etc/exports 的共享目录, 卸载NFS Server共享的目录或者重新共享等.

3, /usr/sbin/showmount
用在 NFS Server 端,而 showmount 则主要用在 Client 端. showmount 可以用來查看 NFS 共享的目录资源.

4, /var/lib/nfs/xtab
NFS的记录文档: 通过它可以查看有哪些Client 连接到NFS主机的记录.

下面这几个并不直接负责NFS, 实际上它们负责所有的RPC
5, /etc/default/portmap
实际上, portmap负责映射所有的RPC服务端口, 它的内容非常非常之简单(后面详述)

6, /etc/hosts.deny
设定拒绝portmap服务的主机

7, /etc/hosts.allow
设定允许portmap服务的主机
安装NFS
Debian/Ubuntu上默认是没有安装NFS服务器的,首先要安装NFS服务程序:
$ sudo apt-get install nfs-kernel-server
(安装nfs-kernel-server时,apt会自动安装nfs-common和portmap)
这样,宿主机就相当于NFS Server。

同样地,目标系统作为NFS的客户端,需要安装NFS客户端程序。如果是Debian/Ubuntu系统,则需要安装nfs-common。
$ sudo apt-get install nfs-commmon

nfs-common和nfs-kernel-server都依赖于portmap!

配置NFS
配置portmap

方法1: 编辑/etc/default/portmap, 将 -i 127.0.0.1 去掉.

方法2: $ sudo dpkg-reconfigure portmap , 对Should portmap be bound to the loopback address? 选N.

配置/etc/hosts.deny
(禁止任何host(主机)能和你的NFS服务器进行NFS连接),加入:
### NFS DAEMONS

portmap:ALL

lockd:ALL

mountd:ALL

rquotad:ALL

statd:ALL

配 置/etc/hosts.allow
允许那些你想要的主机和你的NFS服务器建立连接。下列步骤将允许任何IP地址以192.168.2开头的主机(连 接到NFS服务器上),也可以指定特定的IP地址。参看man页 hosts_access(5), hosts_options(5)。加入:
### NFS DAEMONS

portmap: 192.168.2.

lockd: 192.168.2.

rquotad: 192.168.2.

mountd: 192.168.2.

statd: 192.168.2.

/etc/hosts.deny 和 /etc/hosts.allow 设置对portmap的访问. 采用这两个配置文件有点类似"mask"的意思. 现在/etc/hosts.deny中禁止所有用户对portmap的访问. 再在/etc/hosts.allow 中允许某些用户对portmap的访问.
运行 $ sudo /etc/init.d/portmap restart 重启portmap daemon.

配置/etc/exports
NFS挂载目录及权限由/etc/exports文件定义

比如我要将将我的home目录中的/home/zp/share目录让192.168.2.*的IP共享, 则在该文件末尾添加下列语句:
/home/zp/share 192.168.2.*(rw,sync,no_root_squash)
或者:/home/zp/share 192.168.2.0/24(rw,sync,no_root_squash)

192.168.2.* 网段内的NFS客户端能够共享NFS服务器/home/zp/share目录内容.且有读,写权限, 并且该用户进入/home/zp/share目录后的身份为root
最好加上sync, 否则 $ sudo exportfs -r 时会给出警告, sync是NFS的默认选项.

(运行 $ showmount -e 查看NFS server的export list.

若更改了/etc/exports, 运行 $ sudo exportfs -r 更新

运行 $ sudo /etc/init.d/nfs-kernel-server restart 重启nfs服务)

/etc/exports实际上就是nfs服务器的核心配置文件了. 鸟哥的Linux私房菜列举了一些exports文件的写法.

测试NFS
可以尝试一下挂载本地磁盘(假设本地主机IP地址为:192.128.2.1,将/home/zp/share挂载到/mnt)
$ sudo mount 192.168.2.1:/home/zp/share /mnt
运行 $ df 看看结果
$ sudo umount /mnt

注意被拷贝文件的读/写权限!
另外, 可以使用一定的参数:
使用加参数的办法:mount -o nolock,rsize=1024,wsize=1024,timeo=15 192.168.2.130:/tmp/ /tmp/



 

http://guliqun1983.blog.163.com/blog/static/50111685201292915222553/

NFS挂载问题:clnt-create : RPC : Program not registered  

2012-10-29 13:52:22|  分类:默认分类|  标签:|字号 订阅


环境 ubuntu 10.4  vm 7.1
终端
ifconfig 得到 ubuntu资料
INET ADDR 192.168.0.4
BCAST  192.168.0.255
MASK 255.255.255.0

一 安装NFS
$ sudo apt-get install nfs-kernel-server
$ sudo apt-get install nfs-common

二 配置NFS
1 $ sudo dpkg-reconfigure portmap , 对Should portmap be bound to the loopback address? 选N
2 $ sudo  /etc/default/portmap 末行清除 "-i 127.0.0.1"

三 配置hosts.deny
$ sudo vi  /etc/hosts.deny
文本末添加
### NFS DAEMONS
portmap: ALL
lockd:   ALL
mountd:  ALL
rquotad: ALL
statd:   ALL

四 配置hosts.allow
$ sudo vi /etc/hosts.allow
文本末加入
### NFS DAEMONS
portmap: 192.168.0.
lockd:   192.168.0.
rquotad: 192.168.0.
mountd:  192.168.0.
statd:   192.168.0.
$ sudo /etc/init.d/portmap restart 重启portmap daemon.
显示如下
Since the script you are attempting to invoke has been converted to an
Upstart job, you may also use the restart(8) utility, e.g. restart portmap
portmap start/running, process  XXXX

五 配置/etc/exports
$ sudo vi /etc/exports
文本末添加
/home/work *(rw,sync,no_root_squash)
chmod 777 -R /home/work
$ sudo showmount -e
显示 clnt-create : RPC : Program not registered

$ sudo  exportfs -r 更新

$ sudo  showmount 192.168.0.4 -e
显示
Export list for 192.168.0.4:
/home/work *

六 启用
$ sudo /etc/init.d/nfs-kernel-server restart 重启nfs服务
显示如下
* Stopping NFS kernel daemon                             [ OK ]
* Unexporting directories for NFS kernel daemon...             [ OK ]
* Exporting directories for NFS kernel daemon...                  
exportfs: /etc/exports [1]: Neither 'subtree_check' or 'no_subtree_check' specified for export "*:/home/work".
Assuming default behaviour ('no_subtree_check').
NOTE: this default has changed since nfs-utils version 1.0.x

* Starting NFS kernel daemon  [ OK ]

挂载
mount -t nfs 192.168.0.4:/home/work  /nfsmnt
mount -t nfs 192.168.0.4:/home/work  /nfsmnt  -o nolock

 

你可能感兴趣的:(ubuntu虚拟机与evm3730开发版的开发环境搭建过程)