Pducharme

** GUIDE ** Running Tech and Me Owncloud VM appliance on KVM on Unraid.

3 posts in this topic

Hi,

 

I deciced to move away from the owncloud Docker for multiple reasons.  I was looking for a good appliance VM with Owncloud and automated updates, webmin, other enhencements over the official owncloud VM.  It's where I found the great site techandme.se.  They create and maintain multiple VM appliances; one of them is an "owncloud VM".

 

Getting started

 

1. Get the "Ubuntu 16.04 main (or mirror) Preinstalled Owncloud (PHP 7.0)" from this site : https://www.techandme.se/pre-configured-owncloud-installaton/

 

2. Extract the ZIP or RAR to a folder on your cache drive (or SSD where you want to store the VMs)

I suggest : /mnt/cache/VMs/Disks/owncloud/

 

3. Logon in SSH to your Unraid box with root and convert the vmdk using this command :

 

qemu-img convert -p -f vmdk -O raw /mnt/cache/VMs/Disks/owncloud/owncloud.vmdk /mnt/cache/VMs/Disks/owncloud/owncloud.img

 

4. When the conversion is completed, delete the VMDK and other VMware files (*.vmdk, *.vmx, etc) in the /mnt/cache/VMs/Disks/owncloud/ folder and keep only the new "owncloud.img"

 

5. create a new VM that point to a Ubuntu template.  You can use my XML provided below.

 

7. Boot the VM and follow the Install scripts questions, it's all automated!

 

 

VM details from my XML :

 

  • 1 CPU, 2 Core (6 and 7) - change to the core you want to pin
  • 2GB RAM, max 3GB RAM  - change to RAM you want, 2GB works fine for me
  • br0 network - give an IP from your router, accessible from the LAN
  • VNC passwd is 'test', keymap is 'fr-ca'  - change to what you want
  • 9p Mount:  /unraid (point to /mnt/user)

 

Code of the XML :

 

<domain type='kvm' id='4'>
  <name>Owncloud</name>
  <uuid>581679d8-547d-5591-e63e-60b274d871da</uuid>
  <description>Owncloud VM (techandme.se)</description>
  <metadata>
    <vmtemplate xmlns="unraid" name="Ubuntu" icon="ubuntu.png" os="ubuntu"/>
  </metadata>
  <memory unit='KiB'>3145728</memory>
  <currentMemory unit='KiB'>2097152</currentMemory>
  <memoryBacking>
    <nosharepages/>
  </memoryBacking>
  <vcpu placement='static'>2</vcpu>
  <cputune>
    <vcpupin vcpu='0' cpuset='6'/>
    <vcpupin vcpu='1' cpuset='7'/>
  </cputune>
  <resource>
    <partition>/machine</partition>
  </resource>
  <os>
    <type arch='x86_64' machine='pc-q35-2.5'>hvm</type>
  </os>
  <features>
    <acpi/>
    <apic/>
  </features>
  <cpu>
    <topology sockets='1' cores='2' threads='1'/>
  </cpu>
  <clock offset='utc'>
    <timer name='rtc' tickpolicy='catchup'/>
    <timer name='pit' tickpolicy='delay'/>
    <timer name='hpet' present='no'/>
  </clock>
  <on_poweroff>destroy</on_poweroff>
  <on_reboot>restart</on_reboot>
  <on_crash>restart</on_crash>
  <devices>
    <emulator>/usr/local/sbin/qemu</emulator>
    <disk type='file' device='disk'>
      <driver name='qemu' type='raw' cache='writeback'/>
      <source file='/mnt/cache/VMs/Disks/owncloud/owncloud.img'/>
      <backingStore/>
      <target dev='hdc' bus='virtio'/>
      <boot order='1'/>
      <alias name='virtio-disk2'/>
      <address type='pci' domain='0x0000' bus='0x02' slot='0x04' function='0x0'/>
    </disk>
    <controller type='usb' index='0' model='ich9-ehci1'>
      <alias name='usb'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x07' function='0x7'/>
    </controller>
    <controller type='usb' index='0' model='ich9-uhci1'>
      <alias name='usb'/>
      <master startport='0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x07' function='0x0' multifunction='on'/>
    </controller>
    <controller type='usb' index='0' model='ich9-uhci2'>
      <alias name='usb'/>
      <master startport='2'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x07' function='0x1'/>
    </controller>
    <controller type='usb' index='0' model='ich9-uhci3'>
      <alias name='usb'/>
      <master startport='4'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x07' function='0x2'/>
    </controller>
    <controller type='sata' index='0'>
      <alias name='ide'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x1f' function='0x2'/>
    </controller>
    <controller type='pci' index='0' model='pcie-root'>
      <alias name='pcie.0'/>
    </controller>
    <controller type='pci' index='1' model='dmi-to-pci-bridge'>
      <model name='i82801b11-bridge'/>
      <alias name='pci.1'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x1e' function='0x0'/>
    </controller>
    <controller type='pci' index='2' model='pci-bridge'>
      <model name='pci-bridge'/>
      <target chassisNr='2'/>
      <alias name='pci.2'/>
      <address type='pci' domain='0x0000' bus='0x01' slot='0x01' function='0x0'/>
    </controller>
    <controller type='virtio-serial' index='0'>
      <alias name='virtio-serial0'/>
      <address type='pci' domain='0x0000' bus='0x02' slot='0x03' function='0x0'/>
    </controller>
    <filesystem type='mount' accessmode='passthrough'>
      <source dir='/mnt/user/'/>
      <target dir='unraid'/>
      <alias name='fs0'/>
      <address type='pci' domain='0x0000' bus='0x02' slot='0x01' function='0x0'/>
    </filesystem>
    <interface type='bridge'>
      <mac address='52:54:00:2a:5f:99'/>
      <source bridge='br0'/>
      <target dev='vnet0'/>
      <model type='virtio'/>
      <alias name='net0'/>
      <address type='pci' domain='0x0000' bus='0x02' slot='0x02' function='0x0'/>
    </interface>
    <serial type='pty'>
      <source path='/dev/pts/1'/>
      <target port='0'/>
      <alias name='serial0'/>
    </serial>
    <console type='pty' tty='/dev/pts/1'>
      <source path='/dev/pts/1'/>
      <target type='serial' port='0'/>
      <alias name='serial0'/>
    </console>
    <channel type='unix'>
      <source mode='bind' path='/var/lib/libvirt/qemu/channel/target/domain-Owncloud/org.qemu.guest_agent.0'/>
      <target type='virtio' name='org.qemu.guest_agent.0' state='disconnected'/>
      <alias name='channel0'/>
      <address type='virtio-serial' controller='0' bus='0' port='1'/>
    </channel>
    <input type='tablet' bus='usb'>
      <alias name='input0'/>
    </input>
    <input type='mouse' bus='ps2'/>
    <input type='keyboard' bus='ps2'/>
    <graphics type='vnc' port='5900' autoport='yes' websocket='5700' listen='0.0.0.0' keymap='fr-ca'>
      <listen type='address' address='0.0.0.0'/>
    </graphics>
    <video>
      <model type='qxl' ram='65536' vram='65536' vgamem='16384' heads='1'/>
      <alias name='video0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x0'/>
    </video>
    <memballoon model='virtio'>
      <alias name='balloon0'/>
      <address type='pci' domain='0x0000' bus='0x02' slot='0x05' function='0x0'/>
    </memballoon>
  </devices>
</domain>

 

Configuring 9P Sharing (passthrough of Unraid /mnt/user) :

 

1. Login on the newly build VM using the ocadmin user and the password you setup in the first boot of the VM.

2. become root by typing sudo -i

3. Create the folder /mnt/unraid:

mkdir /mnt/unraid

4. type the following command to go inside the fstab file :

nano /etc/fstab

5. On the last blank line of file fstab, add the following :

unraid /mnt/unraid 9p rw,dirsync,relatime,trans=virtio,version=9p2000.L,posixacl,cache=loose 0 0

6. Quit & save the fstab file (ctrl+x, Yes to save).

7. Reboot the VM.

reboot

 

The new sharing should work and in your Owncloud, you should be able to use "External Storage Support" to point a "local" share to the /mnt/unraid/WhateverFolderYouDesire.

 

 

0

Share this post


Link to post
Share on other sites

Thanks for this, I have used it with their NextCloud VM and works well.

0

Share this post


Link to post
Share on other sites

the VM works without using 9p for networking

I followed the instructions but it starts in emergency mode when using the 9p network addon.

john

 

 

0

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now

Copyright © 2005-2017 Lime Technology, Inc. unRAID® is a registered trademark of Lime Technology, Inc.