Introduction
In this article, we will discuss how to use SMB client to connect and mount a shared folder between a Windows 11 host and an Ubuntu 22.04 guest running in Hyper-V. We will cover the key concepts and provide detailed steps with subtitles and code blocks as needed.
Prerequisites
Before we begin, make sure you have the following:
- A Windows 11 host with Hyper-V enabled
- An Ubuntu 22.04 guest created in Hyper-V
- A shared folder created in Windows 11 and shared with a local user named "shareuser"
Mounting a CIFS Share in Ubuntu 22.04
To mount a CIFS share in Ubuntu 22.04, we will use the mount.cifs command. This command allows us to mount a CIFS share from a remote server or a shared folder from a Windows host.
Step 1: Install CIFS Utilities
First, we need to install the CIFS utilities package in Ubuntu 22.04. Open a terminal and run the following command:
sudo apt-get install cifs-utilsStep 2: Create a Mount Point
Next, we need to create a mount point in Ubuntu 22.04 where we will mount the shared folder. We will create a directory named /mnt/windowsshare using the following command:
sudo mkdir /mnt/windowsshareStep 3: Mount the CIFS Share
Now, we can mount the CIFS share using the mount.cifs command. Here is an example command that mounts the shared folder located at \\wins11host\share with the username shareuser and the password sharepassword.
sudo mount.cifs //wins11host/share /mnt/windowsshare -o user=shareuser,pass=sharepasswordTroubleshooting Mount.cifs Failures
If you encounter issues when trying to mount the CIFS share, here are some troubleshooting steps you can take.
Check the Shared Folder Permissions
Make sure the shared folder in Windows 11 has the correct permissions for the local user "shareuser". You can check the permissions by right-clicking the shared folder, selecting Properties, and then clicking the Security tab.
Check the Firewall Settings
Make sure the firewall on the Windows 11 host is not blocking the CIFS traffic. You can check the firewall settings by going to Control Panel > System and Security > Windows Defender Firewall > Advanced settings.
Check the Network Settings
Make sure the network settings in Ubuntu 22.04 are configured correctly. You can check the network settings by going to Settings > Network.
In this article, we have discussed how to use SMB client to connect and mount a shared folder between a Windows 11 host and an Ubuntu 22.04 guest running in Hyper-V. We have covered the key concepts and provided detailed steps with subtitles and code blocks as needed.
References
- Mount Windows Shares Permanently
- Microsoft SMB Protocol and CIFS Protocol Overview
- Ubuntu Server Download
- Windows Defender Firewall with Advanced Security
This article includes references to the following types of resources:
- Online articles
- Ubuntu documentation
- Microsoft documentation