Skip to content

Instantly share code, notes, and snippets.

@alemures
Last active January 27, 2020 12:45
Show Gist options
  • Save alemures/83cda6e17a593b110c0d1ef1e9e5567b to your computer and use it in GitHub Desktop.
Save alemures/83cda6e17a593b110c0d1ef1e9e5567b to your computer and use it in GitHub Desktop.
Communicate a debian virtual machine with host

Add a host-only network interface to the VM and configure it in "/etc/network/interfaces"

auto enp0s8
iface enp0s8 inet static
address 192.168.56.101
netmask 255.255.255.0
#network 192.168.56.0
#broadcast 192.168.56.255
#gateway 192.168.56.1

Install samba with sudo apt install samba

Add the following lines at the end of "/etc/samba/smb.conf"

[shared]

comment = Debian shared folder
path = /home/<username>/shared
browsable = no
guest ok = no
read only = no
create mask = 0755

Add local user and password to samba database with sudo smbpasswd -a <username>

If the host is a windows and the communication host <-> guest is not working, use this guide to set up the windows firewall https://serverfault.com/a/333584

If host and guest can communicate but windows can't access the shared folder, enable the windows feature SMB 1.0/CIFS Client following the next guide https://www.asus.com/support/FAQ/1037477/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment