Hyper-V
Setup shared folder
To set up a shared folder between a Windows Hyper-V host and a Debian guest, use a traditional Windows network share by creating the share on your Windows host and
then accessing it from the Debian guest using SMB/CIFS and installing the client tools, such as cifs-utils
.
Â
-
Share the Folder on Your Windows Host
- Right-click: on the folder you want to share on your Windows host computer.Â
- Select Properties, then go to the Sharing tab.Â
- Click Share... and grant "Everyone" read/write permissions for simplicity, or configure more granular permissions.Â
- Note the network path of the shared folder, which will look like
\\YourHostName\ShareName
.Â
-
Configure the Debian Guest for Networking
-
Ensure Network Connectivity:
Your Debian guest must be able to communicate with the Windows host. This is usually achieved by setting up an External Virtual Switch in Hyper-V's Virtual Switch Manager, which allows the guest to connect to the physical network.Â
-
Assign IP Addresses:
Make sure both the host and the guest have IP addresses on the same subnet so they can communicate.Â
-
-
Set Up the Share in the Debian GuestÂ
- Install SMB/CIFS Utilities: On your Debian guest, install the necessary tools for mounting Windows shares. sudo apt update sudo apt install cifs-utils
- Create a Mount Point: Create a directory in the guest where you will mount the shared folder. sudo mkdir ~/hostshare
- Mount the Share: Mount the shared folder from the Windows host to the created mount point. sudo mount -t cifs //YourHostName/ShareName ~/hostshare -o user=your_windows_username,uid=$(id -u),gid=$(id -g)
- Replace
YourHostName
,ShareName
, andyour_windows_username
with your actual details. - You will be prompted for your Windows username's password.Â
-
Verify the ShareÂ
- Open a terminal or file manager in your Debian guest.
- Navigate to the
~/hostshare
directory to see the contents of the shared folder from your Windows host.