{"id":23586566,"url":"https://github.com/doctorwkt/build-ubuntu-vm","last_synced_at":"2025-05-07T07:47:14.544Z","repository":{"id":96057268,"uuid":"90684552","full_name":"DoctorWkt/build-ubuntu-vm","owner":"DoctorWkt","description":"Automated Unattended Builds of Various Ubuntu VM Images","archived":false,"fork":false,"pushed_at":"2017-05-09T04:35:14.000Z","size":7819,"stargazers_count":5,"open_issues_count":0,"forks_count":3,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-31T07:51:12.745Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/DoctorWkt.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-05-09T00:26:37.000Z","updated_at":"2020-06-29T23:37:23.000Z","dependencies_parsed_at":null,"dependency_job_id":"ece12b3c-1508-4ac6-8909-5aee47c18adc","html_url":"https://github.com/DoctorWkt/build-ubuntu-vm","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DoctorWkt%2Fbuild-ubuntu-vm","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DoctorWkt%2Fbuild-ubuntu-vm/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DoctorWkt%2Fbuild-ubuntu-vm/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DoctorWkt%2Fbuild-ubuntu-vm/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DoctorWkt","download_url":"https://codeload.github.com/DoctorWkt/build-ubuntu-vm/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252839031,"owners_count":21812083,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-12-27T04:11:35.325Z","updated_at":"2025-05-07T07:47:14.535Z","avatar_url":"https://github.com/DoctorWkt.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# build-ubuntu-vm\n\nThis repository contains a couple of scripts to create a VirtualBox image\nfor a number of Ubuntu flavours. The scripts create a new install ISO\nand then start a VM and boot the ISO. The ISO is set to run unattended,\nand by the end of the process you have a running, fully configured Ubuntu\nVM. You can then shut it down and you have your new VM.\n\n# Pre-requisites\n\nYou will need already installed:\n\n* VirtualBox\n* These packages: whois, p7zip-full, genisoimage\n* A copy of the [Minimal Ubuntu CD](https://help.ubuntu.com/community/Installation/MinimalCD)\n\nIt is also a good idea to install the *apt-cacher-ng* package. The Minimal\nUbuntu CD has very few packages; most of them are installed from the Internet.\nThe *apt-cacher-ng* package will act as a caching proxy, so you can build the\ncustomised ISO several times and only have to download the packages once.\n\n# Making Your Customisations\n\nThe `test1` directory has a file called `config` which holds the customisations\nthat we want to apply to the Minimal Ubuntu CD. You can make your own\ndirectories, so that you can build multiple, different, customised ISO files.\n\nHere are the contents of the `config` file:\n\n```\n# Config file used by the customise_iso script\nusername=fred\npassword=abc123\nrootpassword=abc123\nhostname=ubuntu\ntimezone=Australia/Brisbane\nproxy=http://172.17.120.172:3142\nbase_system=lubuntu-desktop\norig_iso=/tmp/mini_17.04.iso\nnew_iso=/tmp/custom.iso\npackages=\"rcs, build-essential\"\nlate_command='sh /copyit'\n```\n\nThe compulsory lines are *username*, *password*, *hostname*, *timezone*,\n*proxy*, *base_system*, *orig_iso*, *new_iso* and *packages*.\n\nThe *username*, *password*, *hostname* and *timezone* should be obvious. The\n*proxy* is the URL of your caching proxy. The *orig_iso* is the absolute\nlocation of the Minimal Ubuntu CD on your system. The *new_iso* is the\nabsolute location of the customised ISO that will be created.\n\nYou need to choose a specific Ubuntu distribution to customise. This is\ndone with the *base_system* line. According to\n[this web page](https://help.ubuntu.com/16.04/installation-guide/amd64/apbs04.html#preseed-pkgsel),\nthe available options are:\n*    standard (standard tools)\n*    ubuntu-desktop\n*    kubuntu-desktop\n*    edubuntu-desktop\n*    lubuntu-desktop\n*    ubuntu-gnome-desktop\n*    xubuntu-desktop\n*    ubuntu-mate-desktop\n*    lamp-server\n*    print-server (print server)\n\nIf you want extra packages installed, list them as comma-separated\nnames on the *packages* line.\n\nIn the `test1` directory, there is a subdirectory called `cdrom`. Anything\nin this directory is included at the top-level of the `initrd` on the\ncustomised ISO image. These files will be visible in the root directory\nduring the installation process.\n\nThe *late_command* line contains a command which runs during the installation\nprocess. You can use this to do extra customisations which are not already\ncovered. Have a look at the `test1/cdrom/copyit` and `test1/cdrom/rc.local`\nscripts. These copy the VirtualBox Guest Additions to the VM's hard disk,\nand then install the Guest Additions on the first boot from the hard disk.\n\n# Running the Scripts\n\nAssuming that you have downloaded the Minimal Ubuntu CD to\n`/tmp/mini_17.04.iso`, you can now run the `customise_iso` script\nto build the customised ISO at `/tmp/custom.iso`:\n\n```\n$ ./customise_iso test1\nUnpacking /tmp/mini_17.04.iso\nAdding test1/preseed.cfg: 8 blocks\nAdding extra files from test1/cdrom: 15902 blocks\nGenerating /tmp/custom.iso\n```\n\nWith the customised ISO now generated, you can start a VirtualBox VM and\ninstall the system with the `vbox_boot` script:\n\n```\n$ ./vbox_boot test1\n0%...10%...20%...30%...40%...50%...60%...70%...80%...90%...100%\nVirtual machine 'test1' is created and registered.\nUUID: 1d36dc56-06dc-4184-bfc1-2c63936c460c\nSettings file: '/d/VirtualBox/test1/test1.vbox'\n0%...10%...20%...30%...40%...50%...60%...70%...80%...90%...100%\nMedium created. UUID: 10d89167-76ee-49b3-88c0-cf239fa95f7f\nName:            test1\nGroups:          /\nGuest OS:        Ubuntu (64-bit)\nUUID:            1d36dc56-06dc-4184-bfc1-2c63936c460c\nConfig file:     /d/VirtualBox/test1/test1.vbox\nSnapshot folder: /d/VirtualBox/test1/Snapshots\nLog folder:      /d/VirtualBox/test1/Logs\nHardware UUID:   1d36dc56-06dc-4184-bfc1-2c63936c460c\nMemory size:     512MB\n\u003c lots more details of the VM omitted \u003e\n\nWaiting for VM \"test1\" to power on...\nVM \"test1\" has been successfully started.\n```\n\nA new VM window will appear, the ISO will boot and the Ubuntu system\nwill be installed.\n\n# Things to Do\n\nThis is still a work in progress, but it's probably a good starting-off\npoint for you to make your own changes. Some things to add:\n\n* Separate scripts for launching the install in VMware etc.\n* More customisations to add the user, key etc. as required by Vagrant\n* Another script to shut down the VM and package up a Vagrant box\n\nYes, I know that this could all be done with Packer. Feel free to show me\nhow! I just wanted to try doing it with a couple of simple shell scripts :-)\n\nP.S. I borrowed most of the ideas and the shell code from other Github\nrepositories and from various web pages. I wish I had kept track of the\nsources, so my apologies to those people who wrote the original code.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdoctorwkt%2Fbuild-ubuntu-vm","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdoctorwkt%2Fbuild-ubuntu-vm","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdoctorwkt%2Fbuild-ubuntu-vm/lists"}