Linux访问Windows共享文件夹 (转)

简介: 在开发Linux程序中,经常会使用Windows的编辑器进行编辑,这样还要拷贝到Linux服务器,如果有这种开发习惯的同学,可以使用这种方式进行开发。 当然除了这种方法之外,可以再Windows安装nfs服务器,但是我的是64位的win7系统,好多nfs服务器不支持,所以就只能使用这种共享文件夹的方式了。

在开发Linux程序中,经常会使用Windows的编辑器进行编辑,这样还要拷贝到Linux服务器,如果有这种开发习惯的同学,可以使用这种方式进行开发。

当然除了这种方法之外,可以再Windows安装nfs服务器,但是我的是64位的win7系统,好多nfs服务器不支持,所以就只能使用这种共享文件夹的方式了。

 

Windows侧:

1:在Windows下建立共享文件夹。

2:确保Windows用户设置了密码。

Linux侧:

1:安装cifs-utils包,安装后,系统出现mount.cifs命令。或者有的发行包里的mount支持 -t cifs参数。

2:mount.cifs  -o username="共享用户",password="密码" //ip/sharing_folder /mountpoint

 

问题1:在共享虚拟机的文件,编译时会出现如下错误:

arm-none-linux-gnueabi-gcc -lpthread -o beep beep.c beeplib.c
cc1: error: beep.c: Value too large for defined data type
cc1: error: beeplib.c: Value too large for defined data type
make: *** [beep] Error 1

修正方法:sudo mount -t cifs -o username=wx,passwd=wx,nounix,noserverino //192.168.1.108/vm_share /mnt/share

添加了,nounix,noserverino

 

问题2:Unable to umount, device is busy

If you get this error message and the 'umount' as well as 'umount -f' commands don't work, try a "lazy" umount:
umount -l /mnt/badmount
Then mount the share again, as shown below:
mount -t cifs //hostname/goodmount /mnt/goodmount -o username=,password=
Note - using the "cifs" keyword instead of the smbfs keyword after -t will result in fewer problems like this.

 

问题3: mount error 12 = Cannot allocate memory
当通过mount.cifs命令对windows下的文件进行映射时,若文件太大,便会产生这种错误,解决方法是:
修改注册表 HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LanmanServer\Parameters\IRPStackSize项的值大于等于15,若IRPStackSize项不存在,就新建一个DWORD值,点击弹出窗口的的进制为十进制,值写个18就ok了,还要重启一下。

 

http://blog.chinaunix.net/uid-20682890-id-3526098.html

相关文章
|
13天前
|
安全 Linux iOS开发
Binary Ninja 5.1.8104 (macOS, Linux, Windows) - 反编译器、反汇编器、调试器和二进制分析平台
Binary Ninja 5.1.8104 (macOS, Linux, Windows) - 反编译器、反汇编器、调试器和二进制分析平台
159 53
Binary Ninja 5.1.8104 (macOS, Linux, Windows) - 反编译器、反汇编器、调试器和二进制分析平台
|
13天前
|
Linux API iOS开发
Binary Ninja 4.2.6455 (macOS, Linux, Windows) - 反编译器、反汇编器、调试器和二进制分析平台
Binary Ninja 4.2.6455 (macOS, Linux, Windows) - 反编译器、反汇编器、调试器和二进制分析平台
109 14
Binary Ninja 4.2.6455 (macOS, Linux, Windows) - 反编译器、反汇编器、调试器和二进制分析平台
|
23天前
|
安全 Linux 网络安全
Metasploit Pro 4.22.8-2025091701 (Linux, Windows) - 专业渗透测试框架
Metasploit Pro 4.22.8-2025091701 (Linux, Windows) - 专业渗透测试框架
176 2
Metasploit Pro 4.22.8-2025091701 (Linux, Windows) - 专业渗透测试框架
|
23天前
|
JSON 安全 Linux
Nexpose 8.22.0 for Linux & Windows - 漏洞扫描
Nexpose 8.22.0 for Linux & Windows - 漏洞扫描
84 1
Nexpose 8.22.0 for Linux & Windows - 漏洞扫描
|
23天前
|
Linux 网络安全 iOS开发
Metasploit Framework 6.4.90 (macOS, Linux, Windows) - 开源渗透测试框架
Metasploit Framework 6.4.90 (macOS, Linux, Windows) - 开源渗透测试框架
278 1
Metasploit Framework 6.4.90 (macOS, Linux, Windows) - 开源渗透测试框架
|
12天前
|
Linux iOS开发 计算机视觉
GIMP 3.0.6 (Linux, macOS, Windows) 发布 - 免费开源图像编辑器
GIMP 3.0.6 (Linux, macOS, Windows) 发布 - 免费开源图像编辑器
85 0
|
23天前
|
数据管理 Linux iOS开发
Splunk Enterprise 9.4.5 (macOS, Linux, Windows) - 机器数据管理和分析
Splunk Enterprise 9.4.5 (macOS, Linux, Windows) - 机器数据管理和分析
66 0
|
28天前
|
运维 安全 网络安全
Windows Server 2019拨号“找不到设备”?Error 1058解决指南
Windows Server 2019拨号报错1058?别急!这不是硬件故障,而是关键服务被禁用。通过“服务依存关系”排查,依次启动“安全套接字隧道协议”“远程接入连接管理”和“路由与远程访问”服务,仅需4步即可恢复PPPoE或VPN拨号功能,轻松解决网络中断问题。
126 1
|
28天前
|
存储 SQL 人工智能
Windows Server 2025 中文版、英文版下载 (2025 年 9 月更新)
Windows Server 2025 中文版、英文版下载 (2025 年 9 月更新)
675 3
Windows Server 2025 中文版、英文版下载 (2025 年 9 月更新)
|
1月前
|
安全 Unix 物联网
Windows 7 & Windows Server 2008 R2 简体中文版下载 (2025 年 9 月更新)
Windows 7 & Windows Server 2008 R2 简体中文版下载 (2025 年 9 月更新)
215 2