diff --git a/.gitignore b/.gitignore index 7ad9690..9c5798f 100644 --- a/.gitignore +++ b/.gitignore @@ -2,12 +2,10 @@ .svn NetSUSLPInstaller.run -.name -compiler.xml -misc.xml -modules.xml -NetSUS.iml -vcs.xml -workspace.xml +.idea profiles_settings.xml -cgolds.xml +.sudo_as_admin_successful +motd.legal-displayed +packer_cache +output-virtualbox-iso + diff --git a/appliance/README.md b/appliance/README.md new file mode 100644 index 0000000..a574b35 --- /dev/null +++ b/appliance/README.md @@ -0,0 +1,90 @@ +# Creating the NetSUSLP Appliance + +### This guide is for project administrators of the NetSUSLP application. + +The following instructions describe how to use VirtualBox and Packer (utilizing the files contained in the 'appliance' directory) to create an appliance (ova file) of the NetSUSLP application. + +The purpose of the appliance file is to give users an easy to setup virtual machine that already has the NetSUSLP application installed. With the appliance the user can simply import the ova file into their preferred virtualization software and have a running NetSUSLP server. + +## Requirements + +**All requirements are open source and free to use for the purposes of this guide.** + +* VirtualBox +* Packer + +## Installation + +There are several options for installing VirtualBox and Packer. You can either download the installers found below or use various command line options. On a Windows or Redhat host machine it is best to use the downloaded installers. + +* VirtualBox [Download Installer Here](https://www.virtualbox.org/wiki/Downloads) +* Packer [Download Installer Here](https://www.packer.io/downloads.html) + +On a OSX host machine using homebrew + + $ brew cask install virtualbox + $ brew install packer + +On a Debian host machine (Ubuntu). For packer you will need to use the downloaded installer + + $ sudo apt-get install virtualbox + + +## 1. Create the Base VM with Packer + +1. Make sure any changes made to the NetSUSLP codebase are finalized and tested. If you do not have the current repository on your host machine, you will need to clone it. + + $ git clone https://github.com/jamf/NetSUS.git + +2. You will now create the installer for NetSUSLP. Running the CreateNetSUSInstaller.sh script will create a NetSUSLPInstaller.run file. In the base directory of your NetSUS project run the command: + + $ sudo ./CreateNetSUSInstaller.sh + +3. You will now utilize packer to create a base VM with the necessary virtual hardware specifications. The created VM will not have NetSUSLP installed nor have the correct network settings. This process will take some time as it is downloading an iso image of Ubuntu and installing it onto a VM. You can observe the installation by starting VirtualBox and opening the 'NetSUSLP_Setup' VM. Packer will take care of the input necessary to install Ubuntu. To proceed run this command in the `NetSUS/appliance/` directory: + + $ packer build setup.json + +## 2. Install NetSUSLP on the Base VM + +1. Once the packer build is finished the created ovf file will be located in `NetSUS/appliance/output-virtualbox-iso/` + +2. Open VirtualBox and import the created ovf file located in the directory above. To import an ovf file select `File -> Import Appliance -> select file` in the VirtualBox manager page. + +3. Before you spin up the imported VM you will want to add some network settings that will allow the VM to gain access to the internet. You can access the settings by right clicking on the NetSUSLP_Setup VM and selecting 'Settings', then enter the 'Network' tab. The settings that will depend on your host machine's hardware and network environment are 'Attach' and 'Name'. The 'Advanced' section must be set as depicted here: + + + +4. You can now start the VM with the new network settings. The default username and password will be `username: shelluser, password: shelluser`. Before installing NetSUSLP you will want to verify that your VM has internet access. Run a command such as `$ ping google.com` and ensure you receive a response. + +5. Now you must restart the VM. It is important to make sure the VM gets fully powered off before running the NetSUSLP installer. Run this command: + + $ sudo shutdown -P now + +6. Start the VM again through VirtualBox. The installer for NetSUSLP is located in the shelluser home directory. To make the installer runnable, run this command: + + $ chmod +x NetSUSLPInstaller.run + +7. Now you must run the installer with sudo permission. Answer 'yes' for any input the installer asks for. Run this command: + + $ sudo ./NetSUSLPInstaller.run + +## 3. Export the VM as an OVA File + +1. Now you will export the VM with NetSUSLP installed. After verifying that the application is working correctly on the VM, power it down. + +2. In VirtualBox manager, select `File -> Export Appliance -> NetSUSLP_Setup -> Continue` + +3. Now select a location to put the exported ova file. Be sure to name the the file `NetSUSLP_ and select the OVF 2.0 format. + + + +4. When finished make sure no iso, ova, or ovf file is included in the repository. + + + + + + + + + diff --git a/appliance/http/preseed.cfg b/appliance/http/preseed.cfg new file mode 100644 index 0000000..487218c --- /dev/null +++ b/appliance/http/preseed.cfg @@ -0,0 +1,39 @@ +choose-mirror-bin mirror/http/proxy string +d-i base-installer/kernel/override-image string linux-server +d-i clock-setup/utc boolean true +d-i clock-setup/utc-auto boolean true +d-i finish-install/reboot_in_progress note +d-i grub-installer/only_debian boolean true +d-i grub-installer/with_other_os boolean true +d-i partman-auto-lvm/guided_size string max +d-i partman-auto/choose_recipe select atomic +d-i partman-auto/method string lvm +d-i partman-lvm/confirm boolean true +d-i partman-lvm/confirm boolean true +d-i partman-lvm/confirm_nooverwrite boolean true +d-i partman-lvm/device_remove_lvm boolean true +d-i partman/choose_partition select finish +d-i partman/confirm boolean true +d-i partman/confirm_nooverwrite boolean true +d-i partman/confirm_write_new_label boolean true +d-i pkgsel/include string openssh-server cryptsetup build-essential libssl-dev libreadline-dev zlib1g-dev linux-source dkms nfs-common +d-i pkgsel/install-language-support boolean false +d-i pkgsel/update-policy select unattended-upgrades +d-i pkgsel/upgrade select full-upgrade +d-i time/zone string UTC +tasksel tasksel/first multiselect standard, ubuntu-server + +d-i console-setup/ask_detect boolean false +d-i keyboard-configuration/layoutcode string us +d-i keyboard-configuration/modelcode string pc105 +d-i debian-installer/locale string en_US + +# Create shelluser user account. +d-i passwd/user-fullname string shelluser +d-i passwd/username string shelluser +d-i passwd/user-password password shelluser +d-i passwd/user-password-again password shelluser +d-i user-setup/allow-password-weak boolean true +d-i user-setup/encrypt-home boolean false +d-i passwd/user-default-groups shelluser sudo +d-i passwd/user-uid string 900 \ No newline at end of file diff --git a/appliance/setup.json b/appliance/setup.json new file mode 100644 index 0000000..f60c9a9 --- /dev/null +++ b/appliance/setup.json @@ -0,0 +1,74 @@ +{ + "variables": { + "ssh_name": "shelluser", + "ssh_pass": "shelluser" + }, + "provisioners": [ + { + "type": "file", + "source": "../NetSUSLPInstaller.run", + "destination": "/home/shelluser/NetSUSLPInstaller.run" + } + ], + "builders": [ + { + "type": "virtualbox-iso", + "guest_os_type": "Ubuntu_64", + "boot_command": [ + "", + "", + "", + "/install/vmlinuz", + " netcfg/get_domain=vm", + " netcfg/get_hostname=NetSUSLP", + " auto=true", + " priority=critical", + " initrd=/install/initrd.gz", + " preseed/url=http://{{ .HTTPIP }}:{{ .HTTPPort }}/preseed.cfg", + " -- ", + "" + ], + "vboxmanage": [ + [ + "modifyvm", + "{{.Name}}", + "--vram", + "12" + ], + [ + "modifyvm", + "{{.Name}}", + "--cpus", + "2" + ], + [ + "modifyvm", + "{{.Name}}", + "--memory", + "2048" + ], + [ + "modifyvm", + "{{.Name}}", + "--nic1", + "nat" + ] + ], + "vm_name": "NetSUSLP_Setup", + "format": "ovf", + "headless": true, + "disk_size": 307200, + "guest_additions_mode": "disable", + "iso_url": "http://releases.ubuntu.com/trusty/ubuntu-14.04.4-server-amd64.iso", + "iso_checksum": "2ac1f3e0de626e54d05065d6f549fa3a", + "iso_checksum_type": "md5", + "http_directory": "http", + "http_port_min": 9001, + "http_port_max": 9001, + "ssh_username": "{{user `ssh_name`}}", + "ssh_password": "{{user `ssh_pass`}}", + "ssh_wait_timeout": "10000s", + "shutdown_command": "echo {{user `ssh_pass`}} | sudo -S shutdown -P now" + } + ] +} \ No newline at end of file diff --git a/docs/README.md b/docs/README.md index 6d0b4be..8d87cc2 100755 --- a/docs/README.md +++ b/docs/README.md @@ -6,9 +6,10 @@ * [LDAP Proxy](ldap_proxy.md) - how to set up an LDAP proxy * [Accounts](accounts.md) - how to change all assoicated account credentials * [Settings](settings.md) - walkthroughs of each additional option found in the settings page +* [Create Appliance](../appliance/README.md) - for application administrators to create the ova appliance file ## Still have Questions? * GitHub issues are the primary way for communicating about specific proposed changes to this project. -* There is a discussion board located on [JAMF Nation](https://jamfnation.jamfsoftware.com/viewProduct.html?id=180&view=discussions). You are welcome to create an account and contribute to the discussion by asking questions, discussing bugs, or answering questions you may have knowledge about. \ No newline at end of file +* There is a discussion board located on [JAMF Nation](https://jamfnation.jamfsoftware.com/viewProduct.html?id=180&view=discussions). You are welcome to create an account and contribute to the discussion by asking questions, discussing bugs, or answering questions you may have knowledge about. diff --git a/docs/images/attachments/dashboard.png b/docs/images/attachments/dashboard.png index b94d5e3..ee46b46 100644 Binary files a/docs/images/attachments/dashboard.png and b/docs/images/attachments/dashboard.png differ diff --git a/docs/images/attachments/vbox_export.png b/docs/images/attachments/vbox_export.png new file mode 100644 index 0000000..7851f38 Binary files /dev/null and b/docs/images/attachments/vbox_export.png differ diff --git a/docs/images/attachments/vbox_network.png b/docs/images/attachments/vbox_network.png new file mode 100644 index 0000000..dd0bb1c Binary files /dev/null and b/docs/images/attachments/vbox_network.png differ diff --git a/webadmin/var/www/webadmin/inc/header.php b/webadmin/var/www/webadmin/inc/header.php index c38e069..0e1b94c 100644 --- a/webadmin/var/www/webadmin/inc/header.php +++ b/webadmin/var/www/webadmin/inc/header.php @@ -48,7 +48,7 @@ - NetSUS 4.0.0 + NetSUS 4.1.0