Reception of one-segment broadcasting with GNU Radio and gr-isdbt on VirtualBox with vagrant

The virtual machine automatic configuration software vagrant automatically acquires and sets up image files such as Linux by simply writing a text file. GNU Radio is a freeware that realizes software radio, but in order to introduce modules such as gr-isdbt, compilation from source program using pyboms is necessary. In addition, although GNU Radio author does not recommend to use GNU Radio on a virtual machine from the point of performance view. But I would like to use GNU radio on a virtual machine, because GNU radio depends heavily on other softwares. Therefore, I tried to receive one-segment broadcasting using GNU Radio on Linux (debian) on VirtualBox, a virtual machine software, using vagrant.

gr-isdbt on Virtual Box

Typing vagrant up from the terminal of the Mac which introduced vagant, you can set up softwares almost automatically including steps of downloading debian image, compiling GNU Radio and gr-isdbt. By connecting a dongle for receiving DVB-T made by RTL-SDR.com to the PC and doing a bit of additional setup manually, I could receive one-segment broadcasting.

Vagrantfile is as follows.

# -*- mode: ruby -*-
# vi: set ft=ruby :
# http://serverarekore.blogspot.com/2018/01/vagrantnotescinnamon-desktopxrdpdebian.html
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
  config.vm.box = "bento/debian-9.3"
  config.vm.hostname = "gnuradio"
  config.vm.network "forwarded_port", guest: 80, host: 8080
   config.vm.provider :virtualbox do |vbox|
     vbox.name = "gnuradio"
     vbox.gui = true
     vbox.cpus = 2
     vbox.memory = 4096
     vbox.customize [
       "modifyvm", :id,
       "--vram", "256",
       "--clipboard", "bidirectional",
       "--draganddrop", "bidirectional",
     ]
  end

  config.vm.provision "shell", inline: <<-SHELL
apt-get update
apt-get upgrade
#DEBIAN_FRONTEND=noninteractive apt-get -y -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" upgrade
apt-get -y install task-japanese
apt-get -y install  xrdp fcitx-mozc task-cinnamon-desktop tigervnc-standalone-server
apt-get install -y python-pip git libgmp-dev ffmpeg swig gnuradio
apt-get remove gnuradio
#
sed -i -e 's/# ja_JP.UTF-8 UTF-8/ja_JP.UTF-8 UTF-8/' /etc/locale.gen
locale-gen
update-locale LANG=ja_JP.UTF-8
localectl set-locale LANG=ja_JP.UTF-8
localectl set-keymap jp106
ln -sf  /usr/share/zoneinfo/Asia/Tokyo /etc/localtime
cat << EOF > /etc/default/keyboard
XKBMODEL="pc106"
XKBLAYOUT="jp"
XKBVARIANT=""
XKBOPTIONS=""
BACKSPACE="guess"
EOF
cat << EOF > /home/vagrant/.xsessionrc
export GTK_IM_MODULE=fcitx
export QT_IM_MODULE=fcitx
export XMODIFIERS="@im=fcitx"
sed -i -e "s/^EnabledIMList.*$/EnabledIMList=fcitx-keyboard-jp:True,mozc:True,fcitx-keyboard-us:False/" /home/vagrant/.config/fcitx/profile
fcitx-remote -r
fcitx -r -d
EOF
chown vagrant:vagrant .xsessionrc
im-config -n fcitx
sudo -u vagrant bash -i -c "export DISPLAY=:0.0 && fcitx -r"
cp /etc/xrdp/xrdp.ini /etc/xrdp/xrdp.ini.org
cat /etc/xrdp/xrdp.ini.org | gawk '/\\[Globals\\]/,/\\[Xorg\\]/' | sed -e 's/\\[Xorg\\]//' > /etc/xrdp/xrdp.ini
cat << EOF >> /etc/xrdp/xrdp.ini
[Xvnc]
name=Xvnc
lib=libvnc.so
username=ask
password=ask
ap=127.0.0.1
port=-1
EOF
systemctl restart xrdp
systemctl enable xrdp

# install pyboms
pip install git+https://github.com/gnuradio/pybombs.git
cd ~vagrant
su vagrant -c "pybombs auto-config"
su vagrant -c "pybombs recipes add-defaults"
su vagrant -c "pybombs prefix init ~vagrant/prefix -a myprefix -R gnuradio-default"
su vagrant -c "pybombs install gr-osmosdr"
su vagrant -c "git clone httpd://github.com/git-artes/fr-isdbt.git"
SHELL
end
Published on 26th November 2018