Debian side
Install needed packages:
Watchguard side
I have simply taken screen shots for the configuration for the watchguard side:
I often find myself searching the internet for things I know can be done, but can't quite remember how to do. This blog attempts to bring some of these cerebrally elusive items together along with information or opinions on subjects I find myself interested in or having to do as a Sys Admin.
Edit /etc/fstab to change all references to xvd devices to sda in /etc/fstab
On many of the machines I transferred using this method I found that they had no swap partitions after the transfer. So I simply set the disk size slightly bigger than the source disk when initially creating the VM in vSphere, then added a partition with fdisk. I usually set the swap partition as /dev/sda2.
You then need to make that partition a swap partition with (I have found often that a reboot is required before the command works):
# mkswap /dev/sda2
Then you can mount it with:
# swapon /dev/sda2
And see if the swap space is available with:
# free
Don't forget to update /etc/fstab so it is pointing to the correct device for the swap partition so it is automounted at boot.
The CDRom is set to /dev/hdc unless you have changed the VM's hardware settings, update this in /etc/fstab as well.
We need to change grubs configuration so that it automatically boots a with appropriate parameters, this information is stored in /boot/grub/menu.list. You can achieve this by either running the following commands:
sed -i 's/xvd/sd/g' /boot/grub/menu.lst
sed -i 's/console=hvc0//g' /boot/grub/menu.lst
Or edit /boot/grub/menu.lst, find the line that begins # kopt, remove the console=hvc0 from the end and change the "xvd" device to the correct boot device. move down to the botton where the menu choices are configured and change the device and remove the console=hvc0 from each of the one you will likely use (the top one only in my case).
Edit /etc/inittab and comment out the line that begins "co:"
Remove the xenserver specific packages from your apt sources list with:
rm /etc/apt/sources.list.d/citrix.list
Update your packages list:
apt-get update
Remove all the kernels that are installed with:
apt-get remove linux-image*
You will get a warning asking about the removal of the running linux kernel, say "No" to this as we will install another one that we can get headers for in the next step.
Install a more appropriate kernel with:
apt-get install linux-image-2.6-686
Reboot to run the newly installed kernel.
Install VMware tools, details of how in my post here, then reboot to test.
To get the most out of the VM you should switch hardware to paravirutal drivers for SCSI controllers and NICs.
# apt-get install ssh vimSamba
# apt-get install samba winbind krb5-userIf the Samba Server configuration asks you for a "Workgroup/Domain name" you can use short name that you specified for the domain when you created it but as we will replace this file shortly it doesn't actually matter what you put.
# dpkg-reconfigure krb5-configDefault Kerberos version 5 realm: <FQDN for your AD domain in caps>
kinit <username>@<FQDN for your AD domain in caps>So for example, if our FQDN for the domain is test.local and we are using the administrator account we would type:
kinit administrator@TEST.LOCALIf all is well it will ask for the password for the above account, if it accepts the password it will simply return you to the prompt, if there is something amiss it will report an error.
# mv /etc/samba/smb.conf /etc/samba/smb.old.confCreate a new file containing the following:
netbios name = <this machine name>
workgroup = <shortname for you domain>
password server = <FQDN for your domain controller>
realm = <FQDN for your domain>
security = ads
winbind uid = 10000-20000
winbind gid = 10000-20000
winbind separator = +
winbind use default domain = yes
/etc/init.d/samba restart ; /etc/init.d/winbind restartJoin the active directory with:
net ads join -U administratorIf you receive a "DNS update failed" error you should manually add this server to the DNS server for the domain.
/etc/init.d/samba restart ; /etc/init.d/winbind restartCheck the the following commands return with a success:
# wbinfo -t
# wbinfo -uLists users (local and domain).
# wbinfo -gLists domain groups.
# apt-get install squidCopy the squid.conf somewhere safe:
# cp /etc/squid/squid.conf /etc/squid/squid.conf.oldEdit /etc/squid/squid.conf and uncomment (remove the hash from) the following line:
#http_access allow localnetAssuming you are using a RFC1918 network range on your network this will allow you to use the proxy. Save the file and restart squid with:
/etc/init.d/squid restartLog in to a domain joined windows box that is logged on as a domain user in the inetaccess group (or which ever group you chose earlier to add to the auth_param directives). Set the browser to use squid as it's proxy server (squid runs on port 3128) and see if you can get to the internet. If not, you will need to concentrate on getting squid working as a simple proxy before you try to add authentication into the mix.
auth_param ntlm program /usr/bin/ntlm_auth --helper-protocol=squid-2.5-ntlmssp --require-membership-of=<short name of the domain>+inetaccessIf you want basic (very insecure, but handy for fallback) authentication then you will also need the following auth_param section.
auth_param ntlm children 5
auth_param basic program /usr/bin/ntlm_auth --helper-protocol=squid-2.5-basic --require-membership-of=<short name of the domain>+inetaccessTo stop the leaking of your client IP addresses out of the proxy, set forwarded_for to off
auth_param basic children 3
auth_param basic realm Squid proxy-caching web server
auth_param basic credentialsttl 5 hours
forwarded_for offAdd the following after the existing acl entries:
acl users proxy_auth REQUIREDComment out (add a hash to the front of) the line we uncommented before:
http_access allow usersRestart squid
/etc/init.d/squid restartUsing the same domain joined windows box that is logged on as a domain user that you confirmed things were working from earlier see if you still have access.
debug_options ALL,1 33,8Try the proxy again and then look though the log file /var/log/squid/cache.log for clues as to what is going on.
apt-get install ntpIf you machine can access internet time servers, then this is all you need to do, ntp will happily start connecting to the Debian time server pool and sync your time.
server time.mycompany.comRestart the ntp daemon with :
/etc/init.d/ntp restartYou can check what ntp gets up to with:
tail -f /var/log/syslogYou will hopefully see something like the following:
apt-get install krb5-userDefault Kerberos version 5 realm: <FQDN for your domain>
kinit administrator@MYCOMPANY.COMThis will ask you for the password for the above account, which needs to exist on your Active Directory. If you input the password correctly you should be returned to the command prompt, otherwise you will see something like:
kinit(v5): Preauthentication failed while getting initial credentials
apt-get install samba winbindDon't worry what we put for the config of samba as we will replace the file anyway
mv /etc/samba/smb.conf /etc/samba/smb.conf.origCreate /etc/samba/smb.conf with the following contents, change the workgroup and realm to what your AD is set to.
mkdir /storeEdit /etc/nsswitch.conf and ensure that the passwd line looks like this:
chmod 777 /store
passwd: compat winbindRestart the samba and winbind services:
/etc/init.d/samba restart ; /etc/init.d/winbind restartWe now need to join the computer to the active directory with:
net ads join -U administratorAs long as the join reports as successful you should be able to ignore any other failures.
wbinfo -tIf all is well the above command should return:
checking the trust secret for domain NA via RPC calls succeededNow jump onto a domain connected windows PC and see if you can create files in the share as the user mentioned in the "valid users" directive of the smb.conf.
# apt-get update # apt-get upgrade
# apt-get install build-essential psmisc linux-headers-$(uname -r)
# cd # mount /media/cdrom # tar zxvf /media/cdrom/VMware*.tar.gz # cd vmware-tools-distrib # ./vmware-install.pl --default
# cd .. # rm -rf vmware-tools-distribUpdate: You should consider using more efficient virtual hardware and drivers, check out my post about using paravirtualized drivers