Added Basic SMB Managment

This commit is contained in:
Sec Scout 2020-08-19 15:24:52 +01:00
parent 4aa38ad8f9
commit e435f6dcd7
2 changed files with 10 additions and 2 deletions

View File

@ -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

View File

@ -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;;
*)