Skip to main content

Your OwnCloud Server on your Hyper-V – scrap dropbox

Do you want to create your own owncloud server with LVM support and easy updates through packages? Here is an easy guide (Note that Azure VMs do not come with LVM preinstalled on Ubuntu, so this guide is only for on-premise Hyper-V as far as the extension of the disk goes):

Collect information :
External IP to be used :
Internal IP to be used : 192.168.x.x
Ports to be forwarded to the LAN : 80,443,10000 (10000 for webmin administration)
Certificate to be used for secure communication :
Subdomain to be used for access :
Username : adminusername
Password :
Mysql Root Password :
owncloud username : adminusername
owncloud password :
owncloud mariadb database : owncloud
owncloud mariadb username : adminusername
owncloud mariadb password :
Download Software :

Install :
Create a new HyperV Virtual Machine named :
Install Ubuntu using the above ISO and configuring networking and usernames/password as above using the installation
wizard. Make sure to select the OpenSSH server in the end. (all the other steps just hit enter)
Connect to port 22 (ssh) on the server using putty or similar.
Run the following commands :
sudo -s
nano /etc/apt/sources.list

#Add the following lines in the end of the file :
deb sarge contrib
deb sarge contrib
#Hit ctrl+O
#Hit ctrl+X
cd /root
apt-key add jcameron-key.asc
apt-get update
apt-get install webmin
cd /tmp
sudo apt-key add – < Release.key
sudo sh -c “echo ‘deb /’ >>
apt-get update
apt-get install owncloud
apt-get install mariadb-server
mysql -u root -p

#On the mariadb prompt enter :
GRANT ALL ON owncloud.* to ‘owncloud’@’localhost’ IDENTIFIED BY ‘ENTER REQUIRED PASSWORD HERE‘;
sudo apt-get update && sudo apt-get upgrade
sudo apt-get update && sudo apt-get install owncloud
echo “<meta http-equiv=’refresh’ content=’0;url=/owncloud’ />” > /var/www/html/index.html

Go to http://ipaddress
Enter the credentials for the first user as chosen in the collection section of this article.
Where it says Storage and database, select : MySQL/MariaDB
Enter database user,password, and database name as above, leave localhost in the end.
Finish setup

You are done. Go login


Adding an extra 1 TB disk 

Extend the disk by attaching new VHDs
Shutdown the VM
Add an extra disk using hyperv manager (a new scsi disk of size : 1 TB)

#Login to ssh using putty
echo “- – -” > /sys/class/scsi_host/host0/scan
fdisk -l
#Identify the disk , for example it will be /dev/sdb. Then continue (this tutorial assumes sdb)
fdisk /dev/sdb
hit enter
hit enter
hit enter
pvcreate /dev/sdb1
#note the volume name thing. Mine looks like cloud-vg. use this for next steps
vgextend cloud-vg /dev/sdb1
lvextend /dev/cloud-vg/root /dev/sdb1
resize2fs /dev/cloud-vg/root



I am the one