Crashplan Running on Ubuntu in bhyve

Status
Not open for further replies.

nello

Patron
Joined
Dec 30, 2012
Messages
351
Thanks to help from @m0nkey_ and this tutorial, I created a Virtual Machine (VM) using bhyve and installed Ubuntu 16:

http://gavowen.ninja/2016/07/installing-ubuntu-server-16-04-in-freenas-9-10-beehyve/

But I don't understand how to access my new Ubuntu server. Is it strictly a command-line interface is there a way to interact with it via a GUI of some sort. With VirtualBox, VMs can be accessed with a VNC client; is VNC a possibility with bhyve? Yeah, a really basic question; sorry to be such a noob.

I want to install and configure Crashplan within this VM. How do I do it?

Thank you.

- nello


2016.08.07 Update
Apparently, the VM must be started from one SSH window and another SSH window is used as the console for CLI.
  • Start the VM
    Code:
    [root@OctoberGroupNAS] ~# iohyve start ubusrv16
    Starting ubusrv16... (Takes 15 seconds for FreeBSD guests)
    [root@OctoberGroupNAS] ~# Unhandled ps2 mouse command 0xe1
    Unhandled ps2 mouse command 0x0a
    Unhandled ps2 mouse command 0x01
    Unhandled ps2 mouse command 0x41
    Unhandled ps2 mouse command 0x88
    
    [root@OctoberGroupNAS] ~# 


  • Console Login
    Code:
    [root@OctoberGroupNAS] ~# iohyve console ubusrv16
    Starting console on ubusrv16...
    ~~. to escape console [uses cu(1) for console]
    Connected
    Ubuntu 16.04.1 LTS ubuntu16 ttyS0
    ubuntu16 login: nello
    Password: 
    Welcome to Ubuntu 16.04.1 LTS (GNU/Linux 4.4.0-31-generic x86_64)
    ...
    5 packages can be updated.
    0 updates are security updates.
    nello@ubuntu16:~$


2016.08.07 Update
Following the instructions on this page, I installed vnc4server:
http://www.havetheknowhow.com/Configure-the-server/Install-VNC.html

What IP address do I specify on my client to connect to this VNC server?



2016.08.07 Update
In case it helps anyone else, here's an outline of the steps I went through to create a VM on bhyve (using iohyve) and install Ubuntu 16:

1. Create tunables (variable/value/type/comment)

iohyve_enable/YES/rc.conf/Enables iohyve at boot
iohyve_flags
/kmod=1 net=em0/rc.conf/Sets iohyve parameters


2. Create pool for iohyve (specify parent pool)
Code:
[root@OctoberGroupNAS ~]# iohyve setup pool=red
Setting up iohyve pool...                                                  
On FreeNAS installation.                                                    
Checking for symbolic link to /iohyve from /mnt/iohyve...                  
Symbolic link to /iohyve from /mnt/iohyve successfully created.            
[root@OctoberGroupNAS ~]#



3. Check that paths were set up correctly
Code:
[root@OctoberGroupNAS ~]# zfs list | grep iohyve                    
red/iohyve                                                   575K  5.08T   192K
/mnt/iohyve                                                                
red/iohyve/Firmware                                          192K  5.08T   192K
/mnt/iohyve/Firmware                                                      
red/iohyve/ISO                                               192K  5.08T   192K
/mnt/iohyve/ISO                                                            
[root@OctoberGroupNAS ~]#



4. Make sure vmm.ko and nmdm.ko kernel modules are loaded
Code:
[root@OctoberGroupNAS ~]# kldstat
...
32    1 0xffffffff821e7000 1b140b   vmm.ko                                  
33    1 0xffffffff82399000 2ebf     nmdm.ko                                
[root@OctoberGroupNAS ~]#



5. Download Ubuntu 16.04 and check that it downloaded sucessfully
Code:
[root@OctoberGroupNAS ~]# iohyve  fetch ftp://ftp.iinet.net.au/pub/ubuntu-releases/16.04.1/ubuntu-16.04.1-server-amd64.iso
[root@OctoberGroupNAS ~]# iohyve isolist                                    
Listing ISO's...                                                            
ubuntu-16.04.1-server-amd64.iso



6. Create VM and set its parameters
Code:
[root@OctoberGroupNAS ~]#  iohyve create ubusrv16 20G
Creating ubusrv16...                                                        
[root@OctoberGroupNAS ~]# iohyve set ubusrv16 loader=grub-bhyve os=d8lvm ram=2G cpu=1 con=nmdm1 boot=1
Setting ubusrv16 loader=grub-bhyve...                                      
Setting ubusrv16 os=d8lvm...                                                
Setting ubusrv16 ram=2G...                                                  
Setting ubusrv16 cpu=1...                                                  
Setting ubusrv16 con=nmdm1...                                              
Setting ubusrv16 boot=1...                                                  
[root@OctoberGroupNAS ~]# iohyve list                                      
Guest     VMM?  Running  rcboot?  Description                              
ubusrv16  NO    NO       YES      Sun Aug  7 12:01:41 CDT 2016              
[root@OctoberGroupNAS ~]#



7. Start installation
Code:
iohyve install ubusrv16 ubuntu-16.04.1-server-amd64.iso
Installing ubusrv16...



8. From a separate SSH window, connect to console to respond to installation prompts
Code:
iohyve console ubusrv16
When installation is complete, system will reboot. To return the command prompt in the console window type these two characters in rapid succession:
  • <shift>~
  • <control>d


2016.08.13 Update
I found additional information about exiting the console window at https://github.com/pr1ntf/iohyve/blob/master/iohyve.8.txt

console
Consoles into a guest operating system. Utilizes nmdm(4) and cu(1) to open a console on a guest operating system. Since bhyve(8) does not emulate video, so we need to administer the guests via a serial communication device. Since iohyve uses cu(1), you will need to press the tilde (~) twice then period (.) to exit the console. (Think typing ~~. real fast to exit console) If that fails to work, try pressing tilde (~) then press Control + D (^D). Note that on some machines, you cannot escape the console. See conreset below to escape all consoles. Usage: 'iohyve console <name>' where <name> is the name of the guest operating system.

conreset
Ends all console sessions for when things get weird.
 
Last edited:

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,504
Thanks for all the information on this. I'd suggest you may want to give the VM at least 4 GB rather than 2; CrashPlan seems to eat RAM.

Edit: Since I didn't see that you addressed this in your subsequent updates, doesn't the Ubuntu VM have its own IP address? If so, I'd think that's what you'd point your VNC client to.
 

nello

Patron
Joined
Dec 30, 2012
Messages
351
I'd suggest you may want to give the VM at least 4 GB rather than 2;
Yes, good suggestion. One machine that I backup is over 2TB so I need to allocate 2GB just to CrashPlan:

https://support.code42.com/CrashPla..._Settings_For_Memory_Usage_With_Large_Backups

Rather than start from scratch, I found this list of iohyve commands:

https://github.com/pr1ntf/iohyve/blob/master/iohyve.8.txt

Current VM configuration:
Code:
[root@OctoberGroupNAS ~]# iohyve info                                       
Name            Size  RAM  CPU  OS     Loader                               
ubusrv16        -     2G   1    d8lvm  grub-bhyve                           
ubusrv16/disk0  20G   2G   1    d8lvm  grub-bhyve



I increased the RAM allocation with iohyve set:
Code:
[root@OctoberGroupNAS ~]# iohyve set ubusrv16 ram=4G                       
Setting ubusrv16 ram=4G...                                                 
[root@OctoberGroupNAS ~]# 



And the RAM is now 4G:
Code:
[root@OctoberGroupNAS ~]# iohyve info                                       
Name            Size  RAM  CPU  OS     Loader                               
ubusrv16        -     4G   1    d8lvm  grub-bhyve                           
ubusrv16/disk0  20G   4G   1    d8lvm  grub-bhyve                           
[root@OctoberGroupNAS ~]#



For a list of a VM's properties, use iohyve getall:
Code:
[root@OctoberGroupNAS ~]# iohyve getall ubusrv16
Getting ubusrv16 iohyve properties...                                         
bargs          -A_-H_-P                                                       
boot           1                                                             
con            nmdm1                                                         
cpu            1                                                             
description    Sun Aug  7 12:01:41 CDT 2016                                   
install        no                                                             
loader         grub-bhyve                                                     
name           ubusrv16                                                       
os             d8lvm                                                         
persist        1                                                             
ram            4G                                                             
size           20G                                                           
tap            tap0                                                           
[root@OctoberGroupNAS ~]#



2016.09.24 Update

I was having problems with large (> 1TB) backups and so increased the VM's memory to 6GB.
Code:
[root@OctoberGroupNAS ~]# iohyve info                                           
Name            Size  RAM  CPU  OS     Loader                                   
ubusrv16        -     6G   1    d8lvm  grub-bhyve                               
ubusrv16/disk0  20G   6G   1    d8lvm  grub-bhyve                               
[root@OctoberGroupNAS ~]#
The problem remained until I removed and re-installed the client's CrashPlan software and now it's working and flying fast so I don't know what impact, if any, the increase in VM memory had. Yes, I increased the Java memory allocation on CrashPlan both in Ubuntu and the Mac, as Code42 recommends.
 
Last edited:

nello

Patron
Joined
Dec 30, 2012
Messages
351
... doesn't the Ubuntu VM have its own IP address? If so, I'd think that's what you'd point your VNC client to.
Yes, my question should have been, "How do you find Ubuntu's IP address?"

And the answer seems to be, run ifconfig from a Ubuntu console:
Code:
nello@ubuntu16:~$ ifconfig
enp0s3    Link encap:Ethernet  HWaddr 00:a0:98:3a:7f:a7 
          inet addr:10.10.49.123  Bcast:10.10.49.255  Mask:255.255.255.0
          inet6 addr: fe80::2a0:98ff:fe3a:7fa7/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:699457 errors:0 dropped:0 overruns:0 frame:0
          TX packets:38505 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:271629076 (271.6 MB)  TX bytes:2702888 (2.7 MB)

lo        Link encap:Local Loopback 
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:206 errors:0 dropped:0 overruns:0 frame:0
          TX packets:206 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1
          RX bytes:17696 (17.6 KB)  TX bytes:17696 (17.6 KB)

nello@ubuntu16:~$ 


So, in my case, the IP address would be 10.10.49.123.

Perhaps there is a better way to find the IP address?
 

nello

Patron
Joined
Dec 30, 2012
Messages
351
Last edited:

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,504
Perhaps there is a better way to find the IP address?
That's how I'd do it. Or check out the DHCP lease page on my router.
 

cstathoulis

Dabbler
Joined
Sep 1, 2014
Messages
20
Hi,

I've been trying to follow the instructions but each time I always get a grub prompt. I've searched the web but haven't been able to get a clear picture on how to resolve it. Any input would be much appreciated.

Thanks


lqqu [!!] Configure the keyboard tqqk
x x
x Keymap to use: x
x x
x American English x
grub> x Albanian x
x Arabic a x
x Asturian a x
x Bangladesh a x
x Belarusian a x
x Bengali a x
x Belgian a x
x Bosnian a x
x Brazilian a x
x British English a x
x Bulgarian a x
x Bulgarian (phonetic layout) x
x x
x <Go Back> x
x x
mqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqj
 

m0nkey_

MVP
Joined
Oct 27, 2015
Messages
2,739
Hi,

I've been trying to follow the instructions but each time I always get a grub prompt. I've searched the web but haven't been able to get a clear picture on how to resolve it. Any input would be much appreciated.

Thanks


lqqu [!!] Configure the keyboard tqqk
x x
x Keymap to use: x
x x
x American English x
grub> x Albanian x
x Arabic a x
x Asturian a x
x Bangladesh a x
x Belarusian a x
x Bengali a x
x Belgian a x
x Bosnian a x
x Brazilian a x
x British English a x
x Bulgarian a x
x Bulgarian (phonetic layout) x
x x
x <Go Back> x
x x
mqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqj
Watch my video https://forums.freenas.org/index.php?resources/iohyve-set-up-and-basic-usage.9/
 

cstathoulis

Dabbler
Joined
Sep 1, 2014
Messages
20

lmannyr

Contributor
Joined
Oct 11, 2015
Messages
198
Any reason why to install ubuntu server instead of desktop? Wouldn't the desktop version nullify the VNC issue? Also, when installing the server version, is the standard version enough?

thanks
 

m0nkey_

MVP
Joined
Oct 27, 2015
Messages
2,739
Any reason why to install ubuntu server instead of desktop? Wouldn't the desktop version nullify the VNC issue? Also, when installing the server version, is the standard version enough?

thanks
No. The current version of Bhyve in FreeNAS 9.10 does not support VGA consoles.
 

lmannyr

Contributor
Joined
Oct 11, 2015
Messages
198
I using the link above to install VNC4Server.

I'm stuck at the "edit the script" I installed ver 16.04 and there isn't any updates listed for this version. Does that mean this version doesn't need any scrip editing? Or doesn't run fine without editing the scrip?

thanks
 

lmannyr

Contributor
Joined
Oct 11, 2015
Messages
198
Done. I installed a VM of UbunTU 16.04 server via iohyve. I'm an Apple guy and after installing VNC with the link above, all I got was a gray screen. Instead I used this link up to the end of step 2. Then I used the OS X 10.12.2 built in "Screen Sharing" app and entered the ip of the VM. I used the "ifconfig" in the VM console prompt as recommended by nello above. I entered the VM IP into Screen Sharing including the VNC port e.g. 192.168.x.x:5901. I was prompted with the VNCserver password and found myself at the UBUNTU desktop. PERFECT. Installing CRASHPLAN now..
So far, HIGHLY recommended to go this route. Looks very promising.
 

lmannyr

Contributor
Joined
Oct 11, 2015
Messages
198
Done. Crashplan is running and backing up via Ubuntu VM. PIA to have to setup ALL the datasets under NFS sharing, then mounting each one. Need to figure out how to automatically mount all the datasets on reboot.
 

lmannyr

Contributor
Joined
Oct 11, 2015
Messages
198
Nello,

If you have a MAC, you can use Screen Sharing instead the VNC app. Still need to run the VNCSERVER though.
 

nello

Patron
Joined
Dec 30, 2012
Messages
351

nello

Patron
Joined
Dec 30, 2012
Messages
351
Status
Not open for further replies.
Top