# FreeBSD 10 vs VirtualBox 4.3.6 fail to boot after install



## techtonik (Feb 18, 2014)

I installed FreeBSD 10 to VirtualBox 4.3.6 running on Windows Vista from FreeBSD-10.0-RELEASE-i386-bootonly.iso and it fails to boot from the disk after installation. I can't attach .webm video, so I just post two screens.


----------



## Aistis (Feb 22, 2014)

*Re: FreeBSD 10 vs VirtualBox 4.3.6 fail to boot after instal*

Same happened to me, the first time I booted after install, it worked normally. Today I got back home and I got this screen. Though mine was not installed on virtual box.*
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Okay, I think I may have solved this problem. I remembered that when I installed the system (and it ran), I had manually unplug one of my hard drives. So I went to the BIOS to see how they are connected. The hard drive that I was using for FreeBSD was listed as port2, so I opened up the box, swapped the cables and now it runs with both drives connected to the PC. At least for now. So I think it searches for the port 1 instead of the port that it is installed to, I hope this might also help you.


----------



## ShelLuser (Feb 22, 2014)

*Re: FreeBSD 10 vs VirtualBox 4.3.6 fail to boot after instal*



			
				techtonik said:
			
		

> I installed FreeBSD 10 to VirtualBox 4.3.6 running on Windows Vista from FreeBSD-10.0-RELEASE-i386-bootonly.iso and it fails to boot from the disk after installation. I can't attach .webm video, so I just post two screens.


All nice and well but you're not giving us much to go by. Just a few error messages don't cut it. For example; are you actually using ZFS on this environment or not? And if so; how much memory have you reserved for this environment?

Have you build a custom kernel or maybe rebuild the base system?

Also important; when you boot using the cd (ISO) device again does it allow you to access your installed system?

Just today I've set up a FreeBSD 10 test environment myself using VirtualBox 4.2.16 running on Windows 7 and so far I've yet to see a problem happen. I've even taken it one step further by attaching a virtual harddisk which I've used on my FreeBSD 9 (virtual) environment for 'external data'. So things like the ports collection, source tree, documentation and so on. Those are now 'shared' between the two environments.

And even with that somewhat specific setup I haven't had this experience yet.


----------



## SirDice (Feb 22, 2014)

*Re: FreeBSD 10 vs VirtualBox 4.3.6 fail to boot after instal*

More importantly, what kind of hardware did you configure Virtualbox with?


----------



## techtonik (Feb 23, 2014)

*Re: FreeBSD 10 vs VirtualBox 4.3.6 fail to boot after instal*



			
				ShelLuser said:
			
		

> For example; are you actually using ZFS on this environment or not? And if so; how much memory have you reserved for this environment?



I don't know about ZFS. Everything is chosen by default including 128Mb of memory limit set by Virtualbox.



			
				ShelLuser said:
			
		

> Also important; when you boot using the cd (ISO) device again does it allow you to access your installed system?



What should I do to test it?



			
				ShelLuser said:
			
		

> Just today I've set up a FreeBSD 10 test environment myself using VirtualBox 4.2.16 running on Windows 7



Why didn't you use the latest 4.3.6?


----------



## techtonik (Feb 23, 2014)

*Re: FreeBSD 10 vs VirtualBox 4.3.6 fail to boot after instal*



			
				SirDice said:
			
		

> More importantly, what kind of hardware did you configure Virtualbox with?




```
￼OS Type: FreeBSD
￼System Base Memory: 128 MB
Processor(s): 1
Execution Cap: 100%
Boot Order: Floppy, CD/DVD, Hard Disk
VT-x/AMD-V: Enabled
Nested Paging: Enabled

Display
Video Memory: 5 MB
3D Acceleration: Disabled
2D Video Acceleration: Disabled
Remote Desktop Server: Disabled
 
Storage Controller: IDE
  IDE Primary Master:
FreeBSD-10.0.vdi (Normal, 2.00 GB)
 ￼
Audio Host Driver: Windows DirectSound
Controller: ICH AC97
 
Network Adapter 1: Intel PRO/1000 MT Desktop (NAT)
```


----------



## ShelLuser (Feb 23, 2014)

*Re: FreeBSD 10 vs VirtualBox 4.3.6 fail to boot after instal*



			
				techtonik said:
			
		

> ShelLuser said:
> 
> 
> 
> ...


Attach the ISO to the virtual machine again and use it to boot the system. Fire up the live cd mode. Then when you've booted check which harddisks the system detects. Try something like this: `# sysctl kern.disks`. Once you know the name of the disk, I suspect this to be named ada0 then you can check if it actually has any partitions on it using this command: `# gpart show -l ada0`. If the name differs then you should obviously substitute the name I used with the correct one.

It should have at least two partitions and one of them should be of type freebsd-ufs; assuming of course that you did indeed use the default partitioning schemes and didn't opt for any experimental approaches (FreeBSD 10 can automatically set up ZFS on root but it's experimental).

So try to access that partition; use something like this (depending on disk name and partition numbers): `# mount /dev/ada0p2 /mnt`. Then check if you can actually see something when using `ls /mnt`.

Edit: You might also want to check how much free diskspace you have using `df -lh`, perhaps the cause of the problem is easier than we're thinking (2Gb should be enough but it's not exactly much to work with).

If all checks out, so you basically completed the installation but the system simply doesn't boot, then I suspect something to have gone wrong with bootstrapping the harddisk. That can be fixed with gpart, but before I go into that I think you should start with these steps and also share the output with us (at the very least the name of the disk and how many partitions it contains and of which type).



			
				techtonik said:
			
		

> ShelLuser said:
> 
> 
> 
> ...


Simple; I was too lazy to perform the upgrade. I was eager to spend time on FreeBSD so didn't want to bother with having to wait for some update to complete. I'll probably do that somewhere next week.


----------



## techtonik (Feb 24, 2014)

*Re: FreeBSD 10 vs VirtualBox 4.3.6 fail to boot after instal*

Live CD boots ok. System seems to be installed, but does not boot.


----------



## ShelLuser (Feb 24, 2014)

*Re: FreeBSD 10 vs VirtualBox 4.3.6 fail to boot after instal*

Then my best guess is that somehow the install process hasn't bootstrapped the hard disk properly. It's a bit weird, but unfortunately I can't comment on it because when I installed FreeBSD 10 on my test environment I did all of the partitioning and bootstrapping by hand.

Anyway, fortunately this is easily fixable. Start the system using the CD again; either start the live cd modus or simply boot into single user mode. Once the system has booted you should try using this command: `# gpart bootcode -b /boot/pmbr -p /boot/gptboot -i 1 ada0`. This will tell the system to install the pmbr file to your hard disks master boot record. Next it installs the second part of the bootcode (gptboot) to the first partition; indicated by the -i parameter.

After that's done the system should boot normally.


----------



## techtonik (Feb 24, 2014)

*Re: FreeBSD 10 vs VirtualBox 4.3.6 fail to boot after instal*



			
				ShelLuser said:
			
		

> Anyway, fortunately this is easily fixable. Start the system using the CD again; either start the live cd modus or simply boot into single user mode. Once the system has booted you should try using this command: `# gpart bootcode -b /boot/pmbr -p /boot/gptboot -i 1 ada0`



Didn't help. The error is the same.


----------



## wblock@ (Feb 24, 2014)

*Re: FreeBSD 10 vs VirtualBox 4.3.6 fail to boot after instal*

At the mountroot> prompt, enter ufs:/dev/ada0p2

Does it boot?

The pictures make it look like a Tab has been entered.  If so, stop doing that.


----------



## techtonik (Feb 25, 2014)

*Re: FreeBSD 10 vs VirtualBox 4.3.6 fail to boot after instal*

Yes. With this command it booted, but with errors. And after reboot everything is as before.


----------



## wblock@ (Feb 25, 2014)

*Re: FreeBSD 10 vs VirtualBox 4.3.6 fail to boot after instal*

The boot process finds /etc/fstab and mounts the root filesystem from it.  That screen image shows that /etc/fstab does not exist.  From the other errors, it may be that everything in /etc has been deleted or moved.  How that happened is hard to say, certainly a typical install populates /etc.  Downloading source and running `mergemaster -Ui` could recreate /etc, but without knowing what happened, it's questionable whether that would be a good step.

I'd suggest copying any added data from that VM somewhere else, then reinstalling it.  Do not do any custom steps, particularly those from Linux-based guides.


----------



## ZorgBatist (Mar 13, 2014)

*Re: FreeBSD 10 vs VirtualBox 4.3.6 fail to boot after instal*

Please set[]up *y*our hard drive as primary master and your CD drive as primary slave (not the secondary master)  in your IDE settings. I had the same issue and it helped in my case.


----------



## techtonik (Mar 19, 2014)

*Re: FreeBSD 10 vs VirtualBox 4.3.6 fail to boot after instal*

Switching master/slave doesn't help. It appears that there is some error after setting a password in installer, so the installation actually fails, but I couldn't catch it.


----------



## naali (Mar 19, 2014)

*Re: FreeBSD 10 vs VirtualBox 4.3.6 fail to boot after instal*

I had similar issues. Networking didn't work after reboot, key mapping didn't save and everything I downloaded was corrupted. I noticed that /etc/devd.conf was getting corrupted on every reboot. I was using UFS as that is the default in the installer. I then switched to ZFS and after that, there hasn't been issues anymore. While doing these installs, I also noticed two cases when the installer fails at the very end. First case is if the hostname is not set. Second case is if I chose no to the question when it asked if the user I had added was ok, and then added a new one. I had these issues without VT-x, about 2 GB of RAM, about 20 GB in a dynamically expanding hard disk and otherwise default hardware settings offered by the VirtualBox.


----------

