Your SlideShare is downloading. ×
Upcoming SlideShare
Loading in...5

Thanks for flagging this SlideShare!

Oops! An error has occurred.

Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply



Published on

Slides of Kris Moore's talk at AsiaBSDCon 2013

Slides of Kris Moore's talk at AsiaBSDCon 2013

Published in: Technology

  • Be the first to comment

  • Be the first to like this

No Downloads
Total Views
On Slideshare
From Embeds
Number of Embeds
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

No notes for slide


  • 1. Automating the deployment of FreeBSD & PC-BSD® systems AsiaBSDCon 2013 Kris Moore PC-BSD / iXsystems
  • 2. The problem: You want to (quickly) deploy multiple FreeBSD or PC-BSD systems.You like what you hear about this whole “ZFS” thing
  • 3. There are currently two ways to accomplish this:
  • 4. Solution #1● Write your own installation scripts● Configure network booting by hand● Maintain as necessary
  • 5. When to consider Solution #1:● You want to configure everything by hand● You are a FreeBSD God – Congrats!
  • 6. When to not consider Solution #1:● Manual disk partitioning isnt your thing● You work for a living
  • 7. Solution #2● Use the pc-thinclient utility included with PC-BSD & TrueOS
  • 8. When to consider Solution #2:● You dont enjoy disk partitioning● You want to have a weekend
  • 9. Defining some Terms
  • 10. PXE The Preboot eXecution Environment (PXE, alsoknown as Pre-Execution Environment; sometimes pronounced "pixie") is an environment to boot computers using a network interface independently of data storage devices (like hard disks) or installed operating systems.
  • 11. NFS Network File System (NFS) is a distributed file system protocol originally developed by SunMicrosystems in 1984, allowing a user on a client computer to access files over a network in amanner similar to how local storage is accessed. .
  • 12. What you will need:● A system with a network interface (2)?● Running PC-BSD 9.1 / TrueOS 9.1● A few GB of disk space
  • 13. Getting Started● First, checkout a FreeBSD ports tree On TrueOS# portsnap fetch extract update
  • 14. On PC-BSDControl panel → System Manager → Tasks→ Fetch Ports
  • 15. Getting Started
  • 16. Getting Started
  • 17. Getting Started● Install server● Or desktop “Thin-Client” server
  • 18. Short Detour
  • 19. What is Remote Desktop?● The thin-client utility can operate both install server or desktop server● Allows diskless clients to boot via PXE● Brings up GDM login on client
  • 20. Why would you run Remote Desktop?● You have a bunch of low-end clients● You want to simplify backup, security and management
  • 21. Why should you not run Remote Desktop?● You dont have a server with horsepower● You need sound support on the clients
  • 22. Back to your previously scheduled presentation
  • 23. Getting Started● Will run DHCPD● Be careful which cable is used
  • 24. Getting Started
  • 25. Getting started● You may now connect a client system● To PXE boot, you may need to check BIOS on client first
  • 26. Its Demo time!
  • 27. Customizing the install● Of course you will want your own installation options / archives, etc● It is possible to adjust entirely on server side
  • 28. The two key directories:● /home/thinclient/installscripts● /home/thinclient/installarchive Client mounted as:● /installscripts● /installarchive
  • 29. ● pc-sysinstall.example can be used as a template for other installations Example #1 Changing to ZFS
  • 30. Example disk layout:disk0-part=UFS+SUJ 1000 /disk0-part=SWAP 2000 nonedisk0-part=UFS+SUJ 0 /usrcommitDiskLabelConverted to ZFS becomes:disk0-part=ZFS 0 /,/root,/tmp,/usr,/varcommitDiskLabel
  • 31. Example #2Changing installation archive
  • 32. Example install archive:installMedium=locallocalPath=/installarchivepackageType=tarinstallFile=fbsd-release.txzChanged to custom archive:installMedium=locallocalPath=/installarchivepackageType=tarinstallFile=fbsd-8.4-amd64.txz
  • 33. Example #3User Management
  • 34. # Root PasswordrootPass=root# User SetupuserName=krisuserComment=Kris MooreuserPass=krisuserShell=/bin/cshuserHome=/home/krisuserGroups=wheel,operatorcommitUser
  • 35. Example #4Advanced Commands
  • 36. # Run command inside installed systemrunCommand=sh /root/ Run command outside installed systemrunExtCommand=mount -t devfs devfs ${FSMNT}/dev
  • 37. Scalability● All CPU instructions are run on the client● Server is in essence a large “File Server”● Will be mostly disk IO / network speed dependent
  • 38. Example #5Packages, oh my!
  • 39. installPackages=apache22 mysql55-serverCan use short package names, or fullversions.
  • 40. Scalability● Default DHCP server is configured for 99 clients● To adjust edit the file: ● /usr/local/etc/dhcpd.conf ● range;
  • 41. Putting the Automated in “Fully Automated” File: /home/thinclient/installscripts/unattended.cfg● If config exists, the client will boot and begin installation after 30 seconds.● System will shutdown when finished● USE WITH CAUTION!!
  • 42. Tips and Tricks● The PC-BSD GUI installer is your friend● Every install is a scripted install● After installation a copy of the pc- sysinstall.cfg file is saved to: ● /root/pc-sysinstallcfg
  • 43. Tips and Tricks● To greatly speed up installations, use ZFS mirrored drives, SSD, or even TMPFS
  • 44. Whats next?● Improvements to pc-sysinstall ● Allows dist-file installation ● PKGNG support● Faster setup of initial thin-client environment
  • 45. Questions? Comments?
  • 46. Thank you!