Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I want to run Freebsd as a guest OS on kVM running on Ubuntu server 10.04. All howtos mention VNC as a necessity to start and finish the installation process. Can I install freebsd on kVM without using VNC? I would prefer to have a text-based installer that will work on the ssh shell prompt. My whole point here is that I don't want to install any graphical or GUI tools on my Host OS (ubuntu server).

share|improve this question

2 Answers 2

up vote 4 down vote accepted

Try setting up a serial connection to the virtual machine. I am not familiar with kVM, but from reading it sounds like you can set it up with virsh with the console domain-id [devname] option.

$ sudo virsh console <your_vm_name>

Once you have a serial access, you should be able to interact with the FreeBSD bootloader. I don't know which version of FreeBSD you want to install, but when I recently installed FreeBSD 9 BETA2, here were my steps.

Bootloader serial

  • Press 2 at FreeBSD boot option screen to escape to loader prompt
  • type set console=comconsole
    • if you loose interactivity at this point, check to see if the virtual tty baud rate is 9600
  • type autoboot

This should allow for the rest of the installation to be done over the serial interface. If you want to continue having serial access after FreeBSD is installed, then before you reboot at the end of the installation you will want to drop to the command prompt.

Post-install serial

Once you are at the console, you will want to make the following changes:

  • type echo 'console="comconsole"' >> /boot/loader.conf
  • load /etc/ttys in vi
    • Modify the line starting with ttyu0 (might be ttyd0 on other versions of FreeBSD)
    • On that line change dialup to vt100 and off to on
  • after the reboot, the serial terminal should show the boot process, and end with a login prompt

References

http://linux.die.net/man/1/virsh

http://www.cyberciti.biz/faq/linux-kvm-redirecting-freebsd-virtual-machines-console-to-aserialport/

http://www.freebsd.org/doc/handbook/serialconsole-setup.html

http://www.freebsd.org/doc/handbook/term.html

share|improve this answer

You should try using the -curses option with qemu / kvm, which seems to provide virtually the same functionality as the VNC option that every other guide on the internet writes about. With -curses, you get access to the simulated BIOS just as you would with VNC etc.

(I'm similarly trying to install OpenBSD from a Linux box through ssh without VNC, and -curses seems to work exactly as VNC would have.)


On the other hand, the -nographic option requires that your install media is configured to use the serial port (instead of the emulated VGA monitor and the emulated legacy keyboard); something like this is probably an overkill for FreeBSD, whose installer does require text-based graphics, so, YMMV; but for OpenBSD, you can modify the install media as follows (courtesy of http://www.mail-archive.com/misc@openbsd.org/msg98999.html):

apt-get install dvd+rw-tools
echo 'set tty com0' > boot.conf
growisofs -M install52.iso -l -graft-points /etc/boot.conf=boot.conf

kvm -m 1024 -hda /dev/sda -cdrom install52.iso -boot d -nographic

Do note that using the -curses option would require no modification of the regular install media (on the contrary, if your install media requires a serial port for installation, then -curses won't be of much use, as you'd only see what you would have seen on the VGA monitor of a PC, which won't include any serial output):

kvm -m 1024 -hda /dev/sda -cdrom install52.iso -boot d -curses
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.