Difference between revisions of "Create a LiveCD"

From Organic Design wiki
(Sharing files with the virtual machine: forum question re uninstalling GA)
({{legacy}})
 
(5 intermediate revisions by 3 users not shown)
Line 1: Line 1:
{{procedure
+
{{legacy}}
| role  = sysop
+
 
| status = in use
 
}}__NOTOC__
 
 
== Purpose ==
 
== Purpose ==
 
The [[organicdesign-workstation]] package (and currently also the [[Ubuntu Post Install]]) are used to quickly set up a workstation in our network in a standard configuration. Later this will include local content for setting up a customised [[wiki organisation]] including all the training material and procedures.
 
The [[organicdesign-workstation]] package (and currently also the [[Ubuntu Post Install]]) are used to quickly set up a workstation in our network in a standard configuration. Later this will include local content for setting up a customised [[wiki organisation]] including all the training material and procedures.
Line 23: Line 21:
  
 
To enable the shared files, first map the machines CD drive to the ''GuestAdditions'' ISO which is in the menu by default. Then open a root prompt in the virtual machine and run the appropriate script with only shared folder support, for example:
 
To enable the shared files, first map the machines CD drive to the ''GuestAdditions'' ISO which is in the menu by default. Then open a root prompt in the virtual machine and run the appropriate script with only shared folder support, for example:
{{code|<pre>
+
<source>
 
/media/cdrom/VBoxLinuxAdditions-x86.run vfs-module
 
/media/cdrom/VBoxLinuxAdditions-x86.run vfs-module
</pre>}}
+
</source>
  
 
You can then add a new shared folder from the ''device'' menu, and then mount it as in the following example:
 
You can then add a new shared folder from the ''device'' menu, and then mount it as in the following example:
{{code|<pre>
+
<source>
 
mount -t vboxsf sharename mountpoint
 
mount -t vboxsf sharename mountpoint
</pre>}}
+
</source>
This method would be fine if there were a simple and reliable way to uninstall the GuestAdiitions prior to building an ISO, but I can find a way to do this in the documentation. I've asked on their forum [http://forums.virtualbox.org/viewtopic.php?t=14666 here].
+
Note that the GuestAdditions should be removed before creating an ISO since they're only meant to exist on a virtual machine not one installed on real hardware.
  
 
== Building an ISO ==
 
== Building an ISO ==
 
Once the machine is installed, configured and updated an ISO can be built to be uploaded to the site and written to DVD's for distribution. The ISO image which can be written to a DVD or memory stick. RemsterSys removes the home directories and boots into the desktop as a live session user with all the Ubuntu defaults, so the default installed applications and theme may need to be replaced to customise our distribution the way we want it.
 
Once the machine is installed, configured and updated an ISO can be built to be uploaded to the site and written to DVD's for distribution. The ISO image which can be written to a DVD or memory stick. RemsterSys removes the home directories and boots into the desktop as a live session user with all the Ubuntu defaults, so the default installed applications and theme may need to be replaced to customise our distribution the way we want it.
  
 +
=== Install RemasterSys ===
 
First ensure that RemasterSys is installed on the virtual machine by adding their repository to ''/etc/apt/sources.list'' then updating and installing as follows.
 
First ensure that RemasterSys is installed on the virtual machine by adding their repository to ''/etc/apt/sources.list'' then updating and installing as follows.
{{code|<pre>
+
<source>
echo "deb http://www.remastersys.klikit-linux.com/repository remastersys/" >> /etc/apt-sources.list
+
echo "deb deb http://www.geekconnection.org/remastersys/repository ubuntu/" >> /etc/apt-sources.list
 
apt-get update
 
apt-get update
 
apt-get install remastersys
 
apt-get install remastersys
</pre>}}
+
</source>
  
 +
=== Removing the GuestAdditions ===
 +
GuestAdditions need to be removed before creating an ISO since they're only meant to exist on a virtual machine not on a real hardware installation. There's no official removal procedure, but I've asked about it [http://forums.virtualbox.org/viewtopic.php?t=14666 here], and found the following method [http://forums.virtualbox.org/viewtopic.php?t=7839 here]. Do this from a root prompt in the virtual machine.
 +
<source>
 +
find /etc -name "*vboxadd*" -exec rm {} \;
 +
find /etc -name "*vboxvfs*" -exec rm {} \;
 +
rm -r /usr/src/vboxadd-*
 +
rm -r /usr/src/vboxvfs-*
 +
rm /usr/sbin/vboxadd-timesync
 +
rm /lib/modules/`uname -r`/misc/vboxadd.ko
 +
rm /lib/modules/`uname -r`/misc/vboxvfs.ko
 +
</source>
 +
 +
=== Build the ISO ===
 
Simply run the following command to create the ISO image. You may also wish to set some configuration options in ''/etc/remastersys.conf'' first, such as the title of the disc or ISO file and the name of the live session user. It's a good idea to set the boot-loader to "GRUB" so it's the same as the official Ubuntu LiveCD booting process.
 
Simply run the following command to create the ISO image. You may also wish to set some configuration options in ''/etc/remastersys.conf'' first, such as the title of the disc or ISO file and the name of the live session user. It's a good idea to set the boot-loader to "GRUB" so it's the same as the official Ubuntu LiveCD booting process.
{{code|<pre>remastersys dist od-workstation-feb2009.iso</pre>}}
+
<source>
 +
remastersys dist od-workstation-feb2009.iso
 +
</source>
  
=== The generated ISO ===
+
=== About the generated ISO ===
 
Using the current process, the resulting OS installed from the generated ISO leads to the normal Ubuntu default menus, quickbars and program customisations, so we need to find where all those are stored.
 
Using the current process, the resulting OS installed from the generated ISO leads to the normal Ubuntu default menus, quickbars and program customisations, so we need to find where all those are stored.
  
 
All the installed applications, databases and daemons in the source installation will be preserved and will be available to the live session user. But some configuration such as ''/etc/hosts'' will be returned to the defaults. The apt sources and crontab are both preserved.
 
All the installed applications, databases and daemons in the source installation will be preserved and will be available to the live session user. But some configuration such as ''/etc/hosts'' will be returned to the defaults. The apt sources and crontab are both preserved.
  
 +
The ISO can then be uploaded directly to the server, but to transfer to the host machine, you'll need to re-establish the GuestAdditions first.
 +
 +
== See also ==
 +
*[[Custom Live USB]] ''- new updated procedure for this purpose''
 +
*[http://www.hackourlife.com/create-bootable-usb-flash-drive-from-iso-image-in-linux-or-windows/ Create Bootable USB / Flash Drive From ISO Image in Linux or Windows]
 
[[Category:Linux]]
 
[[Category:Linux]]

Latest revision as of 23:58, 30 January 2022

Legacy.svg Legacy: This article describes a concept that has been superseded in the course of ongoing development on the Organic Design wiki. Please do not develop this any further or base work on this concept, this is only useful for a historic record of work done. You may find a link to the currently used concept or function in this article, if not you can contact the author to find out what has taken the place of this legacy item.


Purpose

The organicdesign-workstation package (and currently also the Ubuntu Post Install) are used to quickly set up a workstation in our network in a standard configuration. Later this will include local content for setting up a customised wiki organisation including all the training material and procedures.

Having the workstation package available as a live CD is even more convenient and re-usable still, but is also a bit more difficult because it's really about maintaining an Organic Design distro.

If we could also make the media usable from within an existing operating system rather than only working in a bootable way, then it would replace the current implementation of Training on a stick‎. It shouldn't be too difficult to make a single executable binary for each OS which results in a running instance of a wiki organisation.

Method

VirtualBox.jpg

There are two open source tools used in the procedure; The first is RemasterSys which is used to build a bootable ISO image of the current system to make a replica of it easily installable by others. The second is Sun's VirtualBox which is a very robust and simple application for running virtual x86 machines. Using these we can have two virtual machines running, a 32bit and a 64bit both installed with Ubuntu and all the necessary Organic Design packages and configurations. Both are installed with RemasterSys so that each month we can run each virtual machine, bring it up to date and build its ISO.

You can gain access to detailed configuration of each machine by selecting it from the list and clicking the "settings" button (the machine must be in "Powered Off" state for the settings button to be enabled). One useful non-default setting is to attach the network to the host interface instead to the NAT.

Setting up a virtual machine

VirtualBox is extremely easy to set up and configure. I was able to set up two virtual Ubuntu boxes in about half an hour, one 32bit and one 64bit. To install an OS on the newly created machine, simply select Linux and Ubuntu from the drop-down lists and supply an appropriate Ubuntu installation ISO file for your machines CD/DVD device and then start it, easy as that!

Sharing files with the virtual machine

The way I'd prefer is by tying the network adapter to the host adapter but I haven't been able to get that to work. The alternative is to enable shared files, but this requires the guest additions to be installed into the virtual machine's kernel and I don't know what effect this has on a real machine installed with an ISO that has these additions in it.

To enable the shared files, first map the machines CD drive to the GuestAdditions ISO which is in the menu by default. Then open a root prompt in the virtual machine and run the appropriate script with only shared folder support, for example:

/media/cdrom/VBoxLinuxAdditions-x86.run vfs-module

You can then add a new shared folder from the device menu, and then mount it as in the following example:

mount -t vboxsf sharename mountpoint

Note that the GuestAdditions should be removed before creating an ISO since they're only meant to exist on a virtual machine not one installed on real hardware.

Building an ISO

Once the machine is installed, configured and updated an ISO can be built to be uploaded to the site and written to DVD's for distribution. The ISO image which can be written to a DVD or memory stick. RemsterSys removes the home directories and boots into the desktop as a live session user with all the Ubuntu defaults, so the default installed applications and theme may need to be replaced to customise our distribution the way we want it.

Install RemasterSys

First ensure that RemasterSys is installed on the virtual machine by adding their repository to /etc/apt/sources.list then updating and installing as follows.

echo "deb deb http://www.geekconnection.org/remastersys/repository ubuntu/" >> /etc/apt-sources.list
apt-get update
apt-get install remastersys

Removing the GuestAdditions

GuestAdditions need to be removed before creating an ISO since they're only meant to exist on a virtual machine not on a real hardware installation. There's no official removal procedure, but I've asked about it here, and found the following method here. Do this from a root prompt in the virtual machine.

find /etc -name "*vboxadd*" -exec rm {} \;
find /etc -name "*vboxvfs*" -exec rm {} \;
rm -r /usr/src/vboxadd-*
rm -r /usr/src/vboxvfs-*
rm /usr/sbin/vboxadd-timesync
rm /lib/modules/`uname -r`/misc/vboxadd.ko
rm /lib/modules/`uname -r`/misc/vboxvfs.ko

Build the ISO

Simply run the following command to create the ISO image. You may also wish to set some configuration options in /etc/remastersys.conf first, such as the title of the disc or ISO file and the name of the live session user. It's a good idea to set the boot-loader to "GRUB" so it's the same as the official Ubuntu LiveCD booting process.

remastersys dist od-workstation-feb2009.iso

About the generated ISO

Using the current process, the resulting OS installed from the generated ISO leads to the normal Ubuntu default menus, quickbars and program customisations, so we need to find where all those are stored.

All the installed applications, databases and daemons in the source installation will be preserved and will be available to the live session user. But some configuration such as /etc/hosts will be returned to the defaults. The apt sources and crontab are both preserved.

The ISO can then be uploaded directly to the server, but to transfer to the host machine, you'll need to re-establish the GuestAdditions first.

See also