DaemonForums  

Go Back   DaemonForums > OpenBSD > OpenBSD Installation and Upgrading

OpenBSD Installation and Upgrading Installing and upgrading OpenBSD.

Reply
 
Thread Tools Display Modes
  #1   (View Single Post)  
Old 14th June 2019
bsduser21 bsduser21 is offline
New User
 
Join Date: Jun 2019
Posts: 6
Default Autoinstall step-by-step guide

Hello,
I'd like to install OpenBSD automatically. I already have my install.conf but I don't know what to do next.

I've already been here:
https://man.openbsd.org/autoinstall.8
https://man.openbsd.org/httpd.conf
https://www.openbsd.org/faq/faq4.html
https://openbsd.amsterdam/setup.html

Ideally I'd like you to provide a step-by-step guide on how to "use" install.conf during automatic installation, because at this point it says somethink like "at this IP I could not find your install.conf"...

Thank you.
Reply With Quote
  #2   (View Single Post)  
Old 14th June 2019
jggimi's Avatar
jggimi jggimi is online now
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 6,730
Default

Hello, and welcome!

The autoinstall(8) tool works three ways.
  1. In concert with a diskless(8) network boot of installation media, such as pxeboot(8) on amd64 or i386.
  2. Hosted on a webserver, independent from installation media.
  3. Included as a local file on the installation media.
In order to spoon-feed you, I'll first need to know which of these three flavors you want to eat.
Reply With Quote
  #3   (View Single Post)  
Old 15th June 2019
PapaParrot's Avatar
PapaParrot PapaParrot is offline
parrot
 
Join Date: Jul 2015
Location: Durango, Mx.
Posts: 413
Default

It might also help if you can show us your "install.conf ", and as jggimi said, but I am going to put in different words, we need to know what you will be trying to install to, using the autoinstall feature, and from, as well, for example, " Autoinstall to a webserver, from my PC ", I can't say I have ever tried the Autoinstall, to anything myself, so can't really give any kind of step by step, however the link you showed, seems pretty straight forward, : https://man.openbsd.org/autoinstall.8 , almost like a step by step, but obviously would vary depending on what one is installing to and from where,...
In a way, this error is pretty clear, but it would be better if you could show exactly what the error says,
(I know, sometimes that is not so easy) :
Quote:
because at this point it says somethink like "at this IP I could not find your install.conf"
Logic says, "Put the install.conf file, on the system that is that IP, or make sure the IP / url used points to the correct location/path of the file. The examples in the manual are pretty clear, but I understand how they might not seem so clear to some people, and also would need modification, depending on the situation, maybe if we know more on what or which of these three flavors, some one can give a more clear example. Note: If you do show us your install.conf file, do not include the real password you will be using, and key's, .good luck
__________________
My best friends are parrots
Reply With Quote
  #4   (View Single Post)  
Old 15th June 2019
J65nko J65nko is offline
Administrator
 
Join Date: May 2008
Location: Budel - the Netherlands
Posts: 3,561
Default

It has been a while since I used it but in http://daemonforums.org/showthread.php?t=8825 I attached a tarball that has a Makefile that uploads the install.conf to a (local) web server.
__________________
You don't need to be a genius to debug a pf.conf firewall ruleset, you just need the guts to run tcpdump
Reply With Quote
  #5   (View Single Post)  
Old 16th June 2019
bsduser21 bsduser21 is offline
New User
 
Join Date: Jun 2019
Posts: 6
Default

Hi,
the error looks like this:

Code:
(I)nstall, (U)pgrade, (A)utoinstall or (S)hell? a
vio0: bound to 100.64.3.3 from 100.64.3.2 (fe:e1:bb:d1:73:e7)
Could not determine auto mode.
Response file location? [http://100.64.3.2/install.conf]
Fetching http://100.64.3.2/install.conf
No response file found; non-interactive mode aborted.
and my install.conf looks like this:

Code:
Terminal type? = vt220
System hostname = test
Which network interface do you wish to configure? = vio0 
IPv4 address for = dhcp 
Password for root account? = 
Start sshd(8) by default? = yes
Change the default console to com0? = yes
Setup a user? = user1
Full name for user user1? = user
Password for user user1? = 
Allow root ssh login? = no
Do you expect to run the X Window System? = no
Do you want the X Window System to be started by xdm(1)? = no
Which disk is the root disk? = sd0 
Use (W)hole disk or (E)dit the MBR? = w
Use (A)uto layout, (E)dit auto layout, or create (C)ustom layout? = a
Location of sets? = cd0
Pathname to the sets? = 6.5/amd64
Set name(s) = all
Location of sets? = done
Directory does not contain SHA256.sig. Continue without verification? = yes
What timezone are you in? = Europe/Berlin
Hope this helps .
Reply With Quote
  #6   (View Single Post)  
Old 16th June 2019
bsduser21 bsduser21 is offline
New User
 
Join Date: Jun 2019
Posts: 6
Default

Hi,
I think most suitable are the second and the third option. Could possibly be my host system the webserver while performing autoinstall on my guest system (VM)? If the answer is yes, I choose the second option. If not, I choose the third option.

Thanks.
Reply With Quote
  #7   (View Single Post)  
Old 16th June 2019
jggimi's Avatar
jggimi jggimi is online now
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 6,730
Default

Look at the messages from the autoinstall carefully:
Code:
vio0: bound to 100.64.3.3 from 100.64.3.2 (fe:e1:bb:d1:73:e7)
You have a single network interface, vio0, for your guest virtual machine. According to the autoinstalll(8) man page, "If there is only one network interface, the installer fetches the response file via that interface."
Code:
  Could not determine auto mode.
There is no local install.conf file, and no webserver supplied an install.conf file from 100.64.3.2. The only time a webserver is not needed is when the admin adds the file to the local installation media. The autoinstall(8) man page states, "If either auto_install.conf or /auto_upgrade.conf is found on bsd.rd's built-in RAM disk, autoinstall behaves as if the machine is netbooted, but uses the local response file."
Code:
Response file location? [http://100.64.3.2/install.conf]
You are prompted for an install.conf network location.
Code:
Fetching http://100.64.3.2/install.conf
You pressed Enter.
Code:
No response file found; non-interactive mode aborted.
No functioning webserver with this file was found at 100.64.3.2. To correct this problem, either:
  1. Deploy a webserver on your host that will supply the missing file to your guest.
  2. Edit the bsd.rd RAMDISK kernel to include the file in its root directory.
Personally, I believe provisioning a webserver will be faster and easier. Let me know which you will choose, and if you will need help with this step.
Reply With Quote
  #8   (View Single Post)  
Old 16th June 2019
J65nko J65nko is offline
Administrator
 
Join Date: May 2008
Location: Budel - the Netherlands
Posts: 3,561
Default

If you use a web server you need to (re)generate an index.txt file.

From the Makefile that I referred to in http://daemonforums.org/showthread.p...034#post66836:
Code:
upload: ${CONF}
        egrep ${ARCH_TEST} ${CONF}
        sudo cp -p ${CONF} ${DEST}/${UPLOAD}
        # regenerate directory listing 
        ls -lt ${DEST} >${DEST}/index.txt
If the directory with your install.conf does not have such a file the web server will not serve it.

You can check the web server error log file to see which request it received. (You may have to increase the log level ;-) )
__________________
You don't need to be a genius to debug a pf.conf firewall ruleset, you just need the guts to run tcpdump
Reply With Quote
  #9   (View Single Post)  
Old 16th June 2019
jggimi's Avatar
jggimi jggimi is online now
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 6,730
Default

Responding again for additional clarity.

Setting up a local webserver is as simple as a short httpd:conf(5) file and enabling/starting httpd(8). Each time you need to change your install.conf or add a machine-specific install.conf, you edit or add files in the /var/www/htdocs/ directory.

Editing the contents of the RAMDISK kernel's directory structure requires the use of rdsetroot(8), vnconfig(8), mount(8), and umount(8).
Reply With Quote
Old 16th June 2019
jggimi's Avatar
jggimi jggimi is online now
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 6,730
Default

Quote:
Originally Posted by J65nko View Post
If you use a web server you need to (re)generate an index.txt file.
Oh, true! I'd forgotten this, since I don't do installs/upgrades via local webservers any longer.
Reply With Quote
Old 18th June 2019
bsduser21 bsduser21 is offline
New User
 
Join Date: Jun 2019
Posts: 6
Default

So you say all I need to do is edit my httpd.conf as it's done here: https://openbsd.amsterdam/setup.html and edit the index.html file? If yes, I need to know what they mean by
Code:
root "/htdocs/<install>"
on the site mentioned befire and also how to edit index.html. If you need some more information about my problem, please let me know.

By the way thank you all for your help, I really appreciate it.
Reply With Quote
Old 18th June 2019
jggimi's Avatar
jggimi jggimi is online now
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 6,730
Default

I have questions, and answers.
  1. A: We both stated that the webserver may require -- may -- an "index.txt" file in its root directory, listing all of the files in the root directory. This file is required by the installation script for installing kernels and filesets via http or https. It is the output of ls(1), as described in post #8 above.
  2. A: The "root" directive defines the document root for an httpd(8) server{} directive. See httpd.conf(5) for more information about the root directive, which defines the root directory presented by an httpd(8) webserver.
  3. Q: Do you have a functioning webserver? If so, how do you know it is functioning correctly and presenting services to the guest vm?
  4. Q: Are you an openbsd.amsterdam user? Or are you trying to replicate their server environment in your own facilities?
Reply With Quote
Old 19th June 2019
bsduser21 bsduser21 is offline
New User
 
Join Date: Jun 2019
Posts: 6
Default

I'm sorry. I think I probably didn't explain my situation correctely.

I have a computer with internet connection and OpenBSD 6.4 installed on it. I know how to install OpenBSD the usual way and I know how to create and use a VM. What I want to do is to create a VM and install OpenBSD as a guest system on it with the autoinstall method. I have my install.conf and I don't know how to "serve it" to the installer. I don't have any webserver. I'm not a customer of openbsd.amsterdam. I'm just trying to use their work as a hint.

I know my english is not perfect so I hope you'll understand. Thanks.
Reply With Quote
Old 19th June 2019
PapaParrot's Avatar
PapaParrot PapaParrot is offline
parrot
 
Join Date: Jul 2015
Location: Durango, Mx.
Posts: 413
Default

You will need to setup, and start a "localhost "server , on the host PC, the VM will need to be able to access that server. It might be relevant to know what kind of VM this is, for example I tried experiment with this my self, using a Qemu VM, hosted on my PC, also OpenBsd 6.5.
Quote:
I know how to install OpenBSD the usual way and I know how to create and use a VM. What I want to do is to create a VM and install OpenBSD as a guest system on it with the auto install method.
Why do you want to do it that way, when it is much simpler and easier to just install it the "usual way" ?
Your local OpenBsd system , should have the httpd webserver, is that working ?
You can test it by trying to connect, use your browser and try to connect to "localhost" or "127.0.0.1" In my case I am using Nginx, and needed to start the server first:
Attached Images
File Type: png a-localhost-nginx.png (230.7 KB, 6 views)
__________________
My best friends are parrots
Reply With Quote
Old 19th June 2019
jggimi's Avatar
jggimi jggimi is online now
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 6,730
Default

Thank you! Now I have a better understanding of the situation, and your needs. You can either:
  • Deploy a webserver to provide the autoinstall response fle to the installing system
  • Insert the autoinstall response file into the installation media used by the installing system.
Deploying a webserver requires that you:
  1. Provision and run a webserver, which serves the autoinstall() response file to the installing system.
    This can be the built-in httpd(8) webserver if hosted on OpenBSD, but any webserver can be utilized.
  2. Optionally, provision and run a DHCP server to name the webserver and file. In looking at the autoinstall() man page, I can see specific dhcp-options(5) to name the server and the response file in a dhcpd.conf(5) configuration file, using either OpenBSD's built-in dhcpd(8) server, or that can be used with any DHCP server. Please note: we were wrong: an "index.txt" file is not used to obtain the response file, instead, DHCP names the server and response file. The "index.txt" file is only needed to serve kernels and filesets via http/https.
Inserting the response file into the ramdisk kernel's filesystem steps are:
  1. use rdsetroot(8) to extract a disk image file
  2. use vnconfig(8) to map a vnd(4) pseudo-disk drive to the disk image file
  3. mount(8) the filesystem
  4. Add your response file to the root directory of the filesystem
  5. umount(8) the filesystem
  6. insert the revised disk image into the installation media
I can provide step-by-step instructions for either method.
Reply With Quote
Old 19th June 2019
PapaParrot's Avatar
PapaParrot PapaParrot is offline
parrot
 
Join Date: Jul 2015
Location: Durango, Mx.
Posts: 413
Default

===edited-----
Strange, for some reason I did not see the above posted by jggimi , when I posted this, any way,
jggimi is much more of a expert then I am, I am no expert at all, so best pay attention to him.
=====end edit---and thanks jggimi----

Additional note:
In the link you showed: https://openbsd.amsterdam/setup.html
Where they say:
Code:
/var/www/htdocs/<install>/fe:e1:bb:d1:c8:01-install.conf
You would need to modify this, to fit your situation, but basically it means the "install.conf" needs to be in the /var/www/htdocs/ .
I am not sure why the say : <install>, that could be a directory, and you could name it what ever you want. The point is, you path to it must be correct.
From the above link again:
Code:
server "default" {
    listen on * port 80
    root "/htdocs/<install>"
    location "/pub/OpenBSD/6.5/amd64/*" {
        root "/htdocs/amd64"
        request strip 4
        directory { auto index }
    }
}
Again the <install> , I believe is just a example, that could be any directory name you choose to use.
Note:, the "auto index", this is important, it will solve any problems you may have with accessing the
"install.conf" file, and the need for a index.html, or index.txt, but it is good practice to include a "index.html" file, in the root directory of your server:
Example, mine:
Code:
garry% cd /var/www/htdocs
garry% ls
Images                     fluxbb-1.5.10.tar.gz       public
app.php                    hugotest                   report.php
assets                     images                     search.php
bgplg                      index.html                 sfsdiag.php
birds                      index.php                  styles
common.php                 info.php                   ucp.php
composer.json              mcp.php                    viewforum.php
composer.lock              memberlist.php             viewonline.php
config.php                 myforum                    viewtopic.php
cron.php                   news                       web.config
downloads                  old-index.html             x-index.html
ex-index.php               phpBB-3.2.2.zip            zbblock
faq.php                    phpBB3                     zbblock_0_4_10a3.tar.gz
feed.php                   posting.php
fluxbb                     posts.php
garry%
Note, I have both, index.html, and index.php.
After all said and done though, to setup a "autoinstall" configuration, for a VM on a local PC, seems like a comlicated way, when it is simple to just install normally, on the VM, unless you have some reason that makes it essential to do it this way, I will maybe give it a try, and see myself.
Another screen shot, to demonstrate what the
Code:
   directory { auto index }
is for, it allows for indexing of files, including text files, which the "install.conf" will be, in my case it is all images, ...but hopefully it helps give you a idea.
Attached Images
File Type: png a-localhost-index.png (248.9 KB, 7 views)
__________________
My best friends are parrots

Last edited by PapaParrot; 19th June 2019 at 06:11 PM.
Reply With Quote
Old 20th June 2019
PapaParrot's Avatar
PapaParrot PapaParrot is offline
parrot
 
Join Date: Jul 2015
Location: Durango, Mx.
Posts: 413
Default

I have (just now) succeeded in doing the Autoinstall, from my PC, to a Qemu VM, using the "localhost" server, but there are some differences in what I am using, since I used qemu,
But any way, now I do see how this could be useful, and it (autoinstall) is a pretty neat feature, now that I have a install.conf file that works for me, setting up new VM's is pretty easy, pretty slick really, ..
I made the directory "install", and have the install.conf file there, :
Code:
garry$ pwd
/var/www/htdocs/install
garry$ ls 
install.conf   
garry$
Used 'ifconfig' to determine what the IP "em0" is on the localhost.
My install.conf :
Code:
System hostname = parrot
Which network interface do you wish to configure? = em0
IPv4 address for em0 = dhcp 
Password for root account? = ****
Start sshd(8) by default? = yes
Do you expect to run the X Window System? = yes
Do you want the X Window System to be started by xenodm(1)? = yes
Change the default console to com0? = no
Setup a user? = no 
no
What timezone are you in? = America/Mexico_City
wd0
W
a
Location of sets? = cd0
Set name(s)? = all
done
Directory does not contain SHA256.sig. Continue without verification? = yes
Especially if one wanted or needed to create many VMs, the autoinstall is definitely the way to go.
Attached Images
File Type: png Auto-install.png (226.6 KB, 6 views)
__________________
My best friends are parrots

Last edited by PapaParrot; 20th June 2019 at 12:46 PM.
Reply With Quote
Old 20th June 2019
J65nko J65nko is offline
Administrator
 
Join Date: May 2008
Location: Budel - the Netherlands
Posts: 3,561
Default

You can use the following simple /etc/httpd.conf to start httpd(8)
Code:
# $OpenBSD: httpd.conf,v 1.20 2018/06/13 15:08:24 reyk Exp $
# simplified for serving 'install.conf'

server "example.com" {
        listen on *  port 80
        location * {
                directory auto index
        }
}
To start the server and checking that it is LISTENing for connections:
Code:
hp_server# rcctl enable httpd

hp_server# cat /etc/rc.conf.local
httpd_flags=
xenodm_flags=

hp_server# rcctl start httpd
httpd(ok)

hp_server# netstat -an -f inet | grep '\.80' 
tcp          0      0  *.80                   *.*                    LISTEN
Copy your install.conf file to /var/www/htdocs/ and check with your browser (using the IP address of one our network interfaces) if you can see and the file.
__________________
You don't need to be a genius to debug a pf.conf firewall ruleset, you just need the guts to run tcpdump
Reply With Quote
Old 21st June 2019
PapaParrot's Avatar
PapaParrot PapaParrot is offline
parrot
 
Join Date: Jul 2015
Location: Durango, Mx.
Posts: 413
Default

Additional tip or note:
I had a lot of trouble when I used the various "examples", for my install.conf, all though it was connecting and finding the file ok, it would get to a point and error with something like "not a valid response", or "no response",...
So any way, what I finally did was start a install, normal, manually, and I made notes of my responses, and the order, etc, so then I used those notes to make my install.conf file. Hope that makes sense, another thing that helped me, when it aborted, it does show a path to a log, and that log showed me which response, or lack of response triggered the error.
The only thing I have not figured out, if anyone knows:
When I start the Autoinstall, and it prompts for the location of the "install.conf" file, it gives me a default url, that is not correct for me, so I have to manually type in the url.
Is there a way to modify the Autoinstall, so that it has the correct url for me ? if the manual explains on that, I am not seeing it, or understanding it . Thanks
__________________
My best friends are parrots
Reply With Quote
Old 21st June 2019
TronDD TronDD is offline
Package Pilot
 
Join Date: Sep 2014
Posts: 196
Default

Quote:
Originally Posted by GarryR View Post
Additional tip or note:
I had a lot of trouble when I used the various "examples", for my install.conf, all though it was connecting and finding the file ok, it would get to a point and error with something like "not a valid response", or "no response",...
So any way, what I finally did was start a install, normal, manually, and I made notes of my responses, and the order, etc, so then I used those notes to make my install.conf file. Hope that makes sense, another thing that helped me, when it aborted, it does show a path to a log, and that log showed me which response, or lack of response triggered the error.
If you go through the install manaually, it emails root the responses which can be directly used as an autoinstall file.
Reply With Quote
Reply

Tags
autoinstall, guide, install.conf, not working, openbsd

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Autoinstall, best thing since sliced bread. fvgit OpenBSD Installation and Upgrading 0 10th January 2017 01:27 AM
autoinstall in virtualbox mfaridi OpenBSD Installation and Upgrading 6 12th July 2015 10:45 PM
OpenBSD autoinstall J65nko OpenBSD Installation and Upgrading 4 12th December 2014 01:15 AM
*pkg removal .. when is it an obligatory step? daemonfowl OpenBSD Installation and Upgrading 6 8th May 2012 03:51 AM
phpMyAdmin 3.4.0 is a "huge step" J65nko News 0 12th May 2011 07:19 PM


All times are GMT. The time now is 06:05 PM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
Content copyright © 2007-2010, the authors
Daemon image copyright ©1988, Marshall Kirk McKusick