SOLVED How do you set up the new Docker VM

Status
Not open for further replies.

mow4cash

Contributor
Joined
Jan 20, 2017
Messages
132
How do you set up the new Docker VM? I tried starting it but it won't run. I'm guessing I need add storage somehow and assign an IP?
 
Last edited by a moderator:

Ericloewe

Server Wrangler
Moderator
Joined
Feb 15, 2014
Messages
20,194
You mean the thing that was committed yesterday or something? I'm not sure it's even functional in the nightlies yet.
 

SavageAUS

Patron
Joined
Jul 9, 2016
Messages
418
Any update on this?
 

KrisBee

Wizard
Joined
Mar 20, 2017
Messages
1,288
I'm having this. Would love if this worked!

Which version of FreeNAS are you using? Nightlies or 11.1RC3? It's not clear in either just how far the development has reached, or how this should function once it is completed. But as of now the webui can be used to pull a pre-built rancheros image. It uses grub-byve as the boot mechanism not UEFI , so it is not possible to use VNC to access the VM shell. Once you have setup in the VM via the webui, you'd have to drop to the FreeNAS shell in order to interact with the rancheros vm after is has been "started".
 

SavageAUS

Patron
Joined
Jul 9, 2016
Messages
418
Which version of FreeNAS are you using? Nightlies or 11.1RC3? It's not clear in either just how far the development has reached, or how this should function once it is completed. But as of now the webui can be used to pull a pre-built rancheros image. It uses grub-byve as the boot mechanism not UEFI , so it is not possible to use VNC to access the VM shell. Once you have setup in the VM via the webui, you'd have to drop to the FreeNAS shell in order to interact with the rancheros vm after is has been "started".
When I've tried to create the docker vm it fails to download the image. 11.1 RC3.
Well it creates but when I click start I get the error about failing to download the image.

Sent from my SM-G930F using Tapatalk
 
Last edited:

KrisBee

Wizard
Joined
Mar 20, 2017
Messages
1,288
I gave up on 11.1 RC3 fairly rapidly due to numerous problems like this:

https://forums.freenas.org/index.ph...-beta1-now-available.58674/page-5#post-422338

In the nightlies as of two days ago, the rancheros image turns up in a hidden dataset:

Code:
[chris@freenas ~]$ zfs list 
NAME													   USED  AVAIL  REFER  MOUNTPOINT 
NasPool												   24.8G  21.4G	96K  /mnt/NasPool 
NasPool/.bhyve_containers								 89.9M  21.4G  89.9M  /mnt/NasPool/.bhyve_containers 
NasPool/.system										   11.2M  21.4G	96K  legacy 
NasPool/.system/configs-76c11d7f8a944b3d8e42fe35420dbaa3	88K  21.4G	88K  legacy


Code:
[chris@freenas ~]$ cd /mnt/NasPool/.bhyve_containers/iso_files;ls -l 
total 45861 
-rw-r--r--  1 root  wheel  49363679 Dec 10 10:57 rancheros-bhyve-v1.1.0.img.gz 
[chris@freenas /mnt/NasPool/.bhyve_containers/iso_files]$
 

SavageAUS

Patron
Joined
Jul 9, 2016
Messages
418
The problem is on rc3 it isn't downloading the image. Might try latest nightly.

Sent from my SM-G930F using Tapatalk
 
Last edited by a moderator:

SavageAUS

Patron
Joined
Jul 9, 2016
Messages
418
I gave up on 11.1 RC3 fairly rapidly due to numerous problems like this:

https://forums.freenas.org/index.ph...-beta1-now-available.58674/page-5#post-422338

In the nightlies as of two days ago, the rancheros image turns up in a hidden dataset:

Code:
[chris@freenas ~]$ zfs list
NAME													   USED  AVAIL  REFER  MOUNTPOINT
NasPool												   24.8G  21.4G	96K  /mnt/NasPool
NasPool/.bhyve_containers								 89.9M  21.4G  89.9M  /mnt/NasPool/.bhyve_containers
NasPool/.system										   11.2M  21.4G	96K  legacy
NasPool/.system/configs-76c11d7f8a944b3d8e42fe35420dbaa3	88K  21.4G	88K  legacy


Code:
[chris@freenas ~]$ cd /mnt/NasPool/.bhyve_containers/iso_files;ls -l
total 45861
-rw-r--r--  1 root  wheel  49363679 Dec 10 10:57 rancheros-bhyve-v1.1.0.img.gz
[chris@freenas /mnt/NasPool/.bhyve_containers/iso_files]$
Are you able to post a screen shot or list of the folders \ files in the .bhyve_containers folder please.
I was able to download the image after creating the iso_files folder but the vm always stays in stopped state.
 

KrisBee

Wizard
Joined
Mar 20, 2017
Messages
1,288
I had been testing in qemu/kvm as my Linux desktop supports nested virtualisation, but memory is a bit low on this machine and I hope to revive my old AMD PC for a test on a real machine.

As of now, the nightly downloads the rancheros image OK, but does not unzip it as I expected it to. I'm not a coder, so hadn't made much sense of the commits at https://github.com/freenas/freenas/tree/master/gui/vm but there are these lines in
gui/vm/views.py

Code:
if prebuilt_image and raw_file_cnt:
+						c.call('vm.decompress_gzip', prebuilt_image, raw_file_cnt)
+						c.call('vm.raw_resize', raw_file_cnt, raw_file_resize)


This description "So, we decided to use RanchereOS as our docker system! I have created a RancherOS image that works with bhyve and uploaded it to Ix CDN, this feature basically will download this image, resize(expand) it and run it using bhyve." implies it should run after creation without intervention. It didn't, or least not in my case.

Perhaps FreeNAS 11.1 will be released before the weekend, a Upcoming version 11.1 release note has appeared at r/freenas.

Only after dropping to the shell to use gzip to unzip the rancheros img.gz file and moving the resultant image file to a non-hidden dataset could the webui be used to create a RAW file device for a docker vm. (See below)

After this the VM actually starts and can only be reached via serial console. The files you asked about were in may case as below:

Code:
root@freenas:/ # ls -lR /mnt/NasPool/.bhyve_containers																									  
total 1																																					
drwxr-xr-x  3 root  wheel  3 Dec 12 17:47 configs																											
drwxr-xr-x  2 root  wheel  4 Dec 12 17:46 iso_files																										
																																							
/mnt/NasPool/.bhyve_containers/configs:																													
total 1																																					
drwxr-xr-x  3 root  wheel  4 Dec 12 17:47 4_docker																										  
																																							
/mnt/NasPool/.bhyve_containers/configs/4_docker:																											
total 1																																					
-rw-r--r--  1 root  wheel  56 Dec 12 17:47 device.map																										
drwxr-xr-x  2 root  wheel   3 Dec 12 17:47 grub																											
																																							
/mnt/NasPool/.bhyve_containers/configs/4_docker/grub:
total 5
-rw-r--r--  1 root  wheel  329 Dec 12 17:47 grub.cfg

/mnt/NasPool/.bhyve_containers/iso_files:
total 91957
-rw-r--r--  1 root  wheel  629145600 Dec 12 17:42 rancheros-bhyve-v1.1.0.img
-rw-r--r--  1 root  wheel   49363679 Dec 12 17:47 rancheros-bhyve-v1.1.0.img.gz
root@freenas:/ #


root@freenas:/ # cat /mnt/NasPool/.bhyve_containers/configs/4_docker/grub/grub.cfg
set timeout=0
set default=RancherOS
menuentry "bhyve-image" --id RancherOS {
set root=(hd0,msdos1)
linux /boot/vmlinuz-4.9.45-rancher rancher.password=rancher printk.devkmsg=on rancher.state.dev=LABEL=RANCHER_STATE rancher.state.wait rancher.state.autoformat=[/dev/sda] rancher.resize_device=/dev/sda
initrd /boot/initrd-v1.1.0
}root@freenas:/ #

root@freenas:/ # cat /mnt/NasPool/.bhyve_containers/configs/4_docker/device.map
(hd0) /mnt/NasPool/home/chris/rancheros-bhyve-v1.1.0.imgroot@freenas:/ #



Code:


			   ,		, ______				 _				 _____ _____TM
  ,------------|'------'| | ___ \			   | |			   /  _  /  ___|
 / .		   '-'	|-  | |_/ /__ _ _ __   ___| |__   ___ _ __  | | | \ '--.
 \/|			 |	|   |	// _' | '_ \ / __| '_ \ / _ \ '__' | | | |'--. \
   |   .________.'----'   | |\ \ (_| | | | | (__| | | |  __/ |	| \_/ /\__/ /
   |   |		|   |	 \_| \_\__,_|_| |_|\___|_| |_|\___|_|	 \___/\____/
   \___/		\___/	 Linux 4.9.45-rancher

		 RancherOS #1 SMP Sun Aug 27 23:25:47 UTC 2017 rancher ttyS0
		 docker-sys: 172.18.42.2 eth0: 192.168.0.208 lo: 127.0.0.1
rancher login: rancher
Password:
[rancher@rancher ~]$


After a first boot, the VM refused to boot a second time. To be continued ....
 

Attachments

  • rancher_rawfile.jpeg
    rancher_rawfile.jpeg
    19.2 KB · Views: 436

KrisBee

Wizard
Joined
Mar 20, 2017
Messages
1,288
Thanks Warren, I totally missed that. I guessed wrong. But after re-cloning my base FreeNAS 11-Stable test VM and upgrading to latest nightly, I still do not have a functioning docker VM. In your ref: was the "image file "rancherui.img" pre-created? I pre-created an image file before selecting it in the webui. Anyway, will the docker VM appears to start, there is no response via the serial console. Using htop appears to show the grub2-byve params used and there seems to be a spurious space in the string after the -d switch. Or from ps:

Code:
root@freenas:/mnt/NasPool/.bhyve_containers # ps auxww | grep bhyve  
root	   5285 100.0  0.1 1066264   4836  -  R	17:49	62:34.89 grub-bhyve -m /mnt/NasPool/.bhyve_containers/configs/4_docker/device.map -r host -M 1024
-d /mnt/NasPool/.bhyve_containers/configs/4_docker/grub/ 4_docker
root	   8990   0.0  0.1	6696   2524  0  S+   18:52	 0:00.00 grep bhyve




Maybe it's just my error.
 

Attachments

  • dockerVm_device.jpeg
    dockerVm_device.jpeg
    19.4 KB · Views: 489
  • vm_list.jpeg
    vm_list.jpeg
    24.5 KB · Views: 454
  • htop.jpeg
    htop.jpeg
    16.6 KB · Views: 444
Last edited by a moderator:

wblock

Documentation Engineer
Joined
Nov 14, 2014
Messages
1,506
No, rancherui.img is just the name of the local file into which the image is downloaded. It does not/should not exist beforehand.

The command line is not used until running Docker to install and run Rancher inside the VM.
 

SavageAUS

Patron
Joined
Jul 9, 2016
Messages
418

KrisBee

Wizard
Joined
Mar 20, 2017
Messages
1,288
No, rancherui.img is just the name of the local file into which the image is downloaded. It does not/should not exist beforehand.

The command line is not used until running Docker to install and run Rancher inside the VM.

Ok, the penny's dropped, I mis-read your doc page. Rancher Server is not obligatory, so I quickly tested with portainer + pi-hole.
 

mullcom

Explorer
Joined
Apr 29, 2012
Messages
67
And how do I get the docker hub category in rancher gui?

Skickat från min SM-G955F via Tapatalk
 
Status
Not open for further replies.
Top