Remotely installing Debian using a web browser
This wiki page is about a frontend module for ?cdebconf, debian-installer's installation core, that i wrote to allow people to perform remote graphical Debian installations using a simple tool as a web browser on the client side.
Some screenshots are available to illustrate what a typical web Debian installation would be.
Why was this built?
Imagine you're a sysadmin who has to install Debian on a blind target machine ( no monitor nor input devices available ), then you would probably have to remove the machine from its location, carry it to the laboratory, connect I/O devices, installing the software and moving back the server to its place (whew, what a sweat!).
Wouldn't be nice if you could boot the target machine with a cdrom and continue the installation from your office using a web browser ?
The idea is booting the target machine with a Debian installation image preseeded with a fixed / dynamicaly assigned ip address that start up a web server that allows the sysadmin to connect to with a simple web browser and perform the whole installation process comfortaby sat at his desk.
How about if you add ssh server to installer and do install with ssh conection? sshd.udeb maybe exsist already. Add pereseed file to install sshd.udeb and get root ssh key. After that do ssh connect and perform installation.
Where do i get it ?
You can download sourcecode and comanion CGI files from this location
Can i give it a try "on the road" ?
Pick this installation ISO
boot it as usual, configure the network so that the target machine is reachable on your local net and then, by both opening a shell or switching to VT2, do
Now, a web server should be running on the target machine, listening at port 8000: point your web browser at
http://<target machine's ip address>:8000/cgi-bin/cdebconf.cgi
and have a happy web-installation!
How does it work?
Two distinct components take part to a Debian web installation on the target machine side: a cdebconf frontend module and a generic HTTP server capable of CGI support: original project included developing a minimal web server for the frontend living in its own thread, but later i had second toughts as i felt i was "reinventing the wheel" because many reliable CGI capable small web servers already exist.
The HTTP server is started togheter with the debian-installer and listens for user's input at a fixed IP address and user input is sent through unix pipes to the frontend module by a simple bash script that operates as a CGI application.
I successfully experimented THTTPD web server: it proved to be small, well maintained and offers needed CGI suport, but of course the web frontend can cooperate with any existing, CGI capable, web server.
The frontend module parses the input string coming from the pipe, replies back to cdebconf, waits for the next question(s) to be displayed to arrive and sends an HTML page back to the HTTP server as final answer to the user.
Specific issues that already have been spotted and need to be fixed include
- Currently, the "Continue" button is placed on the left of the "Back" button: some css work has to be done here to swap places
- When a page is displayed to the user, the first of the displayed questions should get the focus
- Sometimes, the HTML page generated by the frontend is not correcty displayed in UTF-8 encoding
Some ideas for further development
- The network board should be automatically configured at boot in order for the web installer to work: should it get a static IP address, like 10.x.x.x, should the IP address be preseeded or should it self configure as a DHCP client?
- Using an SSL socket would allow secure remote installations over the internet, but i never experimented with THTTPD and SSL
- An authentication function, that forces the user to enter username and password, may be desireable
- A double click on a single SELECT question should activates the "Continue" button
- Some kind of "syncookie" mechanism has to be implemented to prevent out-of-order replies by multiple HTTP clients
Also, any future integration in the d-i would require packaging both the web frontend and the web server into udebs and some work to fit everything into the iso building process: here help would be needed in the case the d-i team should decide to include this frontend module into the d-i.
Please contact me at firstname.lastname@example.org