Saturday, November 4, 2017

Making vagrant and virtualbox on Ubuntu 16.04

MY ENVIRONMENT

$ grep RELEASE /etc/lsb-release
DISTRIB_RELEASE=16.04
$
$ vagrant --version
Vagrant 2.0.1
$
$ VBoxManage -v
5.0.40_Ubuntur115130
$ vagrant plugin list
vagrant-hostmanager (1.8.7)
vagrant-share (1.1.9, system)
vagrant-vbguest (0.15.0)

$ vagrant plugin list
vagrant-hostmanager (1.8.7)
vagrant-share (1.1.9, system)
vagrant-vbguest (0.15.0)


STEPS TO INSTALL VITUALBOX AND VAGRANT ON UBUNTU 16.04



VIRTUALBOX

sudo apt-get install virutalbox virtualbox-dkms linux-headers-generic virtualbox-guest-x11
VBoxManage --version # if this complains about device /dev/vboxdrv, do following
sudo dpkg-reconfigure virtualbox-dkms
sudo dpkg-reconfigure virtualbox
sudo modprobe vboxdrv
sudo modprobe vboxnetctl
VBoxManage --version
sudo modprobe vboxnetadp # sudo modprobe vboxnetadp
sudo modprobe vboxnetadp #  sudo modprobe vboxnetadp


VAGRANT

sudo apt-get install vagrant
vagrant plugin install vagrant-vbguest
vagrant plugin install vagrant-hostmanager
sudo apt-get -y install dkms build-essential \
  linux-headers-$(uname -r) virtualbox-guest-additions-iso
apt-get install linux-headers-virtual


ADD A BOX IN VAGRANT
Add a box and start it as mention here 

vagrant status
vagrant ssh


SAMPLE CONFIG FILE TO START 2 VAGRANT BOXES

#Sample Vagrantfile file to start 2 ubuntu boxes
https://www.vagrantup.com/docs/multi-machine/  multi machine configuration reference
# only first machin in below config has been set to start by default

Vagrant.configure("2") do |config|

    config.vm.provider "virtualbox"
    config.vm.network "public_network", bridge: "wlp6s0"

    config.vm.provision 'shell', path: 'install_docker.sh', run: 'always'

   config.vm.define "vm1", primary: true, autostart: true do | vm1 |
      vm1.vm.box = "minimal/xenial64"
      vm1.vm.hostname = 'vm1'

      vm1.vm.provider :virtualbox do |v|
        v.customize ["modifyvm", :id, "--natdnshostresolver1", "on"]
        v.customize ["modifyvm", :id, "--memory", 1024]
        v.customize ["modifyvm", :id, "--name", "vm1"]
      end
   end

   config.vm.define "vm2", autostart: false do | vm2 |
      vm2.vm.box = "minimal/xenial64"
      vm2.vm.hostname = 'vm2'

      vm2.vm.provider :virtualbox do |v|
        v.customize ["modifyvm", :id, "--natdnshostresolver1", "on"]
        v.customize ["modifyvm", :id, "--memory", 1024]
        v.customize ["modifyvm", :id, "--name", "vm2"]
      end
    end
end



References:
https://gist.github.com/larsar/1687725
https://github.com/rekibnikufesin

Sunday, April 16, 2017

How to fix youtube plugin error "quota limit exceeded" on Kodi ( example illustrating OSMC)

Problem: Recently, you might have started getting an error "quota limit exceeded" when you are trying to use youtube plugin on Kodi.

Cause: Reason is - youtube plugin uses google API to get information. Non-paid version has certain Quota limit per day per API Key.

Fix: You can generate and add your own API Key and Secret.

How to Fix it?

I use OSMC on Raspberry Pi. It runs Kodi 16 and youtube plugin. I am listing file path below from my system. It may vary depending on which platform you are using youtube plugin of Kodi.

- Go to https://console.cloud.google.com
- Click on top down-drop error and click 'Create project'. Name it something like - kodi_youtube
- Go to 'API Manager' -> Credentials
- Click Credentials Tab and click 'Create Credential'
- Create API Key and OAuthr 2.0 Client ID as per below document
  https://support.google.com/cloud/answer/6158857?hl=en
- Now you have three strings (1) Client ID (2) API Key (3) Client Secret
- ssh to you kodi installation.
- Add or update (if already existing) below lines in settings.xml (my osmc absolute path is be)
>>>File Name: /home/osmc/.kodi/userdata/addon_data/plugin.video.youtube/settings.xml
>>>You need to add following lines

   
   
   



And you are done! Did this step help you?


Also refer this article.