Created
March 6, 2017 08:28
-
-
Save neelabhg/8c6bfcdb44c0aa3f86bed00fe1f6da49 to your computer and use it in GitHub Desktop.
Mount a Windows host's folder on a QEMU Linux guest
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/bash | |
# The Windows folder needs to be shared appropriately | |
WINDOWS_DIR_PATH="//10.0.2.2/workdir" | |
MNTPOINT="/workdir_local" | |
if [ ! -d "$MNTPOINT" ]; then | |
mkdir $MNTPOINT | |
fi | |
if [ -z "$WIN_USERNAME" ]; then | |
echo "Please set WIN_USERNAME in .bashrc" | |
exit 1 | |
fi | |
umount $MNTPOINT > /dev/null 2>&1 | |
echo "Use your Windows password to mount $WINDOWS_DIR_PATH at $MNTPOINT" | |
mount -t cifs -o user="$WIN_USERNAME",uid=501,gid=501 "$WINDOWS_DIR_PATH" "$MNTPOINT" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Here is my solution to mount a Windows host shared folder on Ubuntu guest
On Windows host, a shared folder need to be setup, right click a folder, Properties -> Sharing, e.g
shared_windows_folder
On Ubuntu guest, do the following
You will see
shared_windows_folder
content on/mnt
.