在Debian虚拟机中实现资源共享可以通过以下几种方法:
使用Samba服务:
sudo apt update
sudo apt install samba
sudo mkdir /var/www
/etc/samba/smb.conf
,添加共享文件夹配置:[global]
workgroup = WORKGROUP
security = user
deadtime = 0
[www]
comment = WebTest
path = /var/www
browseable = yes
guest ok = yes
read only = no
create mask = 0777
directory mask = 0777
sudo systemctl restart smbd
sudo systemctl restart nmbd
\\192.168.1.100\www
,然后输入Samba用户名和密码即可访问共享文件夹。使用VirtualBox共享文件夹:
sudo mkdir /mnt/shared
sudo mount -t vboxsf share /mnt/shared
/etc/fstab
文件中:share /mnt/shared vboxsf rw,gid=100,uid=1000,auto 0 0
使用SSHFS挂载远程文件系统:
sudo apt update
sudo apt install sshfs
sudo mkdir /mnt/ssh_folder
sudo sshfs user@your_remote_ip:/path/to/remote_folder /mnt/ssh_folder
/etc/fstab
文件中:user@your_remote_ip:/path/to/remote_folder /mnt/ssh_folder fuse.sshfs-9 allow_other 0 0
亿速云「云服务器」,即开即用、新一代英特尔至强铂金CPU、三副本存储NVMe SSD云盘,价格低至29元/月。点击查看>>
相关推荐:ubuntu虚拟机如何实现资源共享