From 628d1ee088a2aa5cc1aca15f9cd02883a639c0fd Mon Sep 17 00:00:00 2001 From: Ben <69906659+secscout@users.noreply.github.com> Date: Tue, 20 Oct 2020 08:49:56 +0000 Subject: [PATCH] Added Basic SMB Managment (#43) Co-authored-by: Sec Scout --- README.md | 2 ++ quickemu | 10 ++++++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 9032dbb..42ba95e 100644 --- a/README.md +++ b/README.md @@ -270,6 +270,7 @@ You can also pass optional parameters --snapshot info : Show disk/snapshot info. --status-quo : Do not commit any changes to disk/snapshot. --fullscreen : Starts VM in full screen mode (Ctl+Alt+f to exit)" + --no-smb : Do not expose the home directory via SMB. ``` ## TODO @@ -285,3 +286,4 @@ You can also pass optional parameters - [x] Improve stdout presentation - [x] Make disk image size configurable - [ ] [Add Faux OEM](# https://code.launchpad.net/~ubuntu-installer/ubiquity/+git/ubiquity/+merge/379899) + - [x] Improve SMB Management diff --git a/quickemu b/quickemu index 48179dc..41f398d 100755 --- a/quickemu +++ b/quickemu @@ -353,13 +353,15 @@ function vm_boot() { # Set the hostname of the VM local NET="user,hostname=${VMNAME}" - # If smbd is available, export $HOME to the guest via samba - if [ -e "${VIRGIL_PATH}/usr/sbin/smbd" ]; then + # If smbd is available, and --no-smb is not set, export $HOME to the guest via samba + if [[ -e "${VIRGIL_PATH}/usr/sbin/smbd" && -z ${NO_SMB} ]]; then NET="${NET},smb=${HOME}" fi if [[ ${NET} == *"smb"* ]]; then echo " - smbd: ${HOME} will be exported to the guest via smb://10.0.2.4/qemu" + elif [[ ${NO_SMB} -eq 1 ]]; then + echo " - smbd: ${HOME} will not be exported to the guest. '--no-smb' is set." else echo " - smbd: ${HOME} will not be exported to the guest. 'smbd' not found." fi @@ -523,6 +525,7 @@ function usage() { echo " --status-quo : Do not commit any changes to disk/snapshot." echo " --system-qemu : Use system install of qemu." echo " --fullscreen : Starts VM in full screen mode" + echo " --no-smb : Do not expose the home directory via SMB." exit 1 } @@ -594,6 +597,9 @@ else -system-qemu|--system-qemu) SYSTEM_QEMU=1 shift;; + -no-smb|--no-smb) + NO_SMB=1 + shift;; -h|--h|-help|--help) usage;; *)