< ^ txt
Wed May 27 09:25:15 EDT 2015
Slept well. It's supposed to be even hotter today.
Goals:
Work:
- Look at isolating vm's in a test network
Done. See below.
- Look at sharing a volume from linux to Windows clients (smb)
http://debian-handbook.info/browse/stable/sect.windows-file-server-with-samba.html
https://wiki.debian.org/SambaServerSimple
--- zol --- ~ $ ############ Create volume which we will share ############
--- zol --- ~ $ sudo lvcreate --size 450G --name smbshare vg0
--- zol --- ~ $ sudo mkfs.ext4 /dev/vg0/smbshare
--- zol --- ~ $ sudo mkdir /smbshare
--- zol --- ~ $ sudo mount /dev/vg0/smbshare /smbshare
--- zol --- ~ $ sudo blkid | grep smbshare
/dev/mapper/vg0-smbshare: UUID="71c614a7-6767-4d99-bd10-da4ac53326ea" TYPE="ext4"
--- zol --- ~ $ sudo -s
root@zol:/home/paulgorman# echo 'UUID="71c614a7-6767-4d99-bd10-da4ac53326ea" /smbshare ext4 defaults 0 2' >> /etc/fstab
root@zol:/home/paulgorman# exit
--- zol --- ~ $ ############ Start samba configuration ############
--- zol --- ~ $ sudo apt-get install samba
--- zol --- ~ $ sudo cp /etc/samba/smb.conf /home/paulgorman/tmp/
--- zol --- ~ $ sudo vim /etc/samba/smb.conf
--- zol --- ~ $ sudo diff -u1 /home/paulgorman/tmp/smb.conf /etc/samba/smb.conf
--- /home/paulgorman/tmp/smb.conf 2015-05-27 13:51:33.430285706 -0400
+++ /etc/samba/smb.conf 2015-05-27 14:01:27.889183487 -0400
@@ -37,3 +37,3 @@
# Change this to the workgroup/NT-domain name your Samba server will part of
- workgroup = WORKGROUP
+ workgroup = MYDOMAIN
@@ -239,3 +239,3 @@
# public shares, not just authenticated ones
- usershare allow guests = yes
+ usershare allow guests = no
@@ -291,3 +291,3 @@
path = /var/spool/samba
- printable = yes
+ printable = no
guest ok = no
@@ -301,3 +301,3 @@
path = /var/lib/samba/printers
- browseable = yes
+ browseable = no
read only = yes
@@ -333 +333,10 @@
+
+[smbshare]
+path = /smbshare
+available = yes
+valid users = smbuser
+read only = no
+browseable = yes
+public = no
+writable = yes
--- zol --- ~ $ sudo useradd -M -s /bin/false smbuser
--- zol --- ~ $ sudo smbpasswd -a smbuser
--- zol --- ~ $ sudo chown smbuser /smbshare/
--- zol --- ~ $ sudo service samba restart
--- zol --- ~ $ testparm
Questions:
- Virtual network for virtual machines?
http://www.linux-kvm.org/page/Networking
(Man, the kvm docs are pretty spotty!)
https://wiki.archlinux.org/index.php/Network_bridge
http://wiki.libvirt.org/page/VirtualNetworking
I guess the scenario I'm thinking of is spinning up one or more guests isolated to a virtual network, not connected to the outside, for temporary testing.
I suppose we can just add a bridge, and connect the vm's but not the real physical interface.
brctl addbr br-tmp
ifconfig br-tmp up
We can then set our vm to use the new bridge either through `virt-manager` or by editing `/etc/libvirt/qemu/foo.xml` to point to our new bridge like:
<interface type='bridge'>
<mac address='52:54:00:eb:6e:5b'/>
<source bridge='br-tmp'/>
<model type='virtio'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
</interface>
When we're done with the bridge (though I don't believe it will persist across a reboot anyhow):
brctl delbr br-tmp
< ^ txt