Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
vms:freenas [2015/10/08 15:54]
admin [Using SSHFS to Access VM's Files]
vms:freenas [2017/03/31 15:13] (current)
admin ↷ Links adapted because of a move operation
Line 11: Line 11:
  
 ---- ----
-++++|+
 ===== Shortcut ===== ===== Shortcut =====
 ---- ----
  
-OK, for the ones that do not want to take the deep dive into the gruesome details of building a FreeNAS development VM. Or if you simply don't have the time required to achieve the whole process, as it takes more than 3 hours to complete all described operations! Here is a download link to the .vdi file that is going to get build following the steps described in this article (you lucky ones!):+OK, for the ones that do not want to take the deep dive into the gruesome details of building a FreeNAS development VM. Or if you simply don't have the time required to achieve the whole process, as it takes more than 3 hours to complete all described operations! Here is a download link to the .vdi file that is going to get build following the steps described in this article ​+/- 663MB (you lucky ones!):
  
-DOWNLOAD LINK (not yet available sorry) +Note that you'll probably have to create extra virtual drives for the VM to create a "​virtual pool". 
-+++++ 
 +**{{:​vms:​freenas:​freenas-dev-9.3.1.vdi|Download FreeNAS-Dev-9.3.1.vdi}}**
 ---- ----
 ===== Create a FreeBSD 9.3 Build Environment ===== ===== Create a FreeBSD 9.3 Build Environment =====
Line 355: Line 356:
  
 > Network > Global Configuration > Network > Global Configuration
 +> Hostname: freenasDEV
 > Default Gateway : 10.0.2.1 > Default Gateway : 10.0.2.1
 > Nameserver 1 : 8.8.8.8 > Nameserver 1 : 8.8.8.8
 > Nameserver 2 : 8.8.4.4 > Nameserver 2 : 8.8.4.4
  
 +=== VM Snapshot ===
  
 +As our FreeNAS dev platform is now basicaly configured, it's time to make a snapshot of it (using VirtualBox GUI application for example).
 ---- ----
 ==== Additional Packages ==== ==== Additional Packages ====
Line 409: Line 413:
 <​code>​ <​code>​
 > sudo mkdir /​mnt/​FreeNAS-DEV-9.3.1 > sudo mkdir /​mnt/​FreeNAS-DEV-9.3.1
 +> sudo chown -R <​devuser>:<​devgroup>​ /​mnt/​FreeNAS-9.3.1
 </​code>​ </​code>​
  
 === (un)Mount the VM's FS on host system === === (un)Mount the VM's FS on host system ===
 <​code>​ <​code>​
-sudo sshfs root@172.20.20.3:/​ /​mnt/​FreeNAS-DEV-9.3.1+> sshfs root@172.20.20.3:/​ /​mnt/​FreeNAS-DEV-9.3.1
 </​code>​ </​code>​
  
 <​code>​ <​code>​
-sudo umount /​mnt/​FreeNAS-DEV-9.3.1+> umount /​mnt/​FreeNAS-DEV-9.3.1
 </​code>​ </​code>​
  
Line 424: Line 429:
 ---- ----
 ==== Create a SAMBA Share to Ease FreeNAS GUI's Files Edition ==== ==== Create a SAMBA Share to Ease FreeNAS GUI's Files Edition ====
- 
  
 <WRAP center round tip> <WRAP center round tip>
Line 432: Line 436:
 </​WRAP>​ </​WRAP>​
  
-Since we won't be able to use shared folders with FreeBSD (as described in this wiki's [[vms:​django#​using_a_shared_folder_to_host_your_projects|Python/​Django Development Environment section]]) we'll have to create a SAMBA shared folder to easily manage and edit FreeNAS GUI's files from our host system.+++++ CLICK HERE TO READ| 
 + 
 +Since we won't be able to use shared folders with FreeBSD (as described in this wiki's [[vms:python:​django#​using_a_shared_folder_to_host_your_projects|Python/​Django Development Environment section]]) we'll have to create a SAMBA shared folder to easily manage and edit FreeNAS GUI's files from our host system.
  
 As the intention is to analyze, and maybe modify, some code in the FreeNAS GUI and/or api, our main target directory location is //​**/​usr/​local/​www/​freenasUI**//​. We'll first duplicate it's content to the host's HD, then make this duplicate directory a SAMBA shared folder that we'll access from the FreeNAS development VM. Finally this SAMBA share will be mounted, with adequate ownership and permissions,​ as the ///​usr/​local/​www/​freenasUI//​ directory inside the FreeNAS development VM. As the intention is to analyze, and maybe modify, some code in the FreeNAS GUI and/or api, our main target directory location is //​**/​usr/​local/​www/​freenasUI**//​. We'll first duplicate it's content to the host's HD, then make this duplicate directory a SAMBA shared folder that we'll access from the FreeNAS development VM. Finally this SAMBA share will be mounted, with adequate ownership and permissions,​ as the ///​usr/​local/​www/​freenasUI//​ directory inside the FreeNAS development VM.
Line 583: Line 589:
  
 Let's restart our VM to check everything goes as expected once we reboot the machine. Let's restart our VM to check everything goes as expected once we reboot the machine.
 +
 +----
 +++++
 +
 +----
 +===== IntelliJ IDEA Project Configuration =====
 +----
 +
 +Now that we have access to the FreeNAS files, we'll create an IntelliJ IDEA project to manage our development actions.
 +
 +Open **IntelliJ IDEA** and create a **new project**:
 +
 +  * Project type: Python
 +  * Project SDK:
 +    * ... -> Add Remote
 +    * SSH Credentials
 +    * Host: 172.20.20.3
 +    * User name: root
 +    * Password: 123456
 +    * Python interpreter path: /​usr/​local/​bin/​python
 +  * Additional Libraries and Frameworks: Django
 +  * Template language: Django
 +  * Templates folder: templates
 +  * Application name: FreeNAS-9.3.1
 +  * No Django admin
 +
 +-> Next -> Next
 +
 +  * Project name: FreeNAS-9.3.1
 +  * Project location: /​mnt/​FreeNAS-DEV-9.3.1/​usr/​local/​www/​freenasUI
 +  * Leave all default for "More Settings"​
 +
 +-> Finnish
 +
 +Warning says files cannot be watched for external update because they are network-mounted.
 +
 +=== Initiate git repo ===
 +
 +(menu) VCS > Enable Version Control Integration : git
 +
 +
 +