Wednesday, September 30, 2020

Enabling UEFI Support For KVM Virtual Machines on Manjaro Deepin Edition (“Mikah,” Manjaro 20.1)

 This is an immediate followup for post at Lxer.com   http://lxer.com/module/newswire/view/291652/index.html

Tested on Virtual Box VM (Manjaro Deepin) , i.e. VENV testing . Manjaro Deepin VM (L1) was launched via Virtual Box with nested virtualization enabled .  

Seems to be fixed via $ sudo pacman -S edk2-ovmf

{sudo] password for boris:

resolving dependencies...

looking for conflicting packages...

Packages (1) edk2-ovmf-202005-3

Total Download Size: 4,39 MiB

Total Installed Size: 11,82 MiB

:: Proceed with installation? [Y/n] Y

:: Retrieving packages...

edk2-ovmf-202005-3-any 4,4 MiB 681 KiB/s 00:07 [############################] 100%(1/1) checking keys in keyring [############################] 100%(1/1) checking package integrity [############################] 100%(1/1) loading package files [############################] 100%(1/1) checking for file conflicts [############################] 100%(1/1) checking available disk space [############################] 100%:: Processing package changes... (1/1) installing edk2-ovmf [############################] 100%:: Running post-transaction hooks... (1/1) Arming ConditionNeedsUpdate...


Virtual Box VM CentOS 8.2 started in UEFI mode











Tuesday, September 29, 2020

Setting up Fedora 33 beta L1&&L2 KVM guests all seating on the same office LAN

Following below verifies Fedora 33 beta L1 Guest ability to perform KVM deployment Fedora 33 beta L2 Guest inside itself .

Deployment is based on bridge to virtual interface of L1 F33 beta guest ( rather then NAT ) due to L1 guest has been deployed on external office network , L2 Guest also appears to be set up on the same external network. Server Fedora 32  (bare metal) has been placed on office LAN via Cockpit Web Console. On L1 Fedora 33 beta Guest we have manually set up bridge br01 via nmcli CLI. 

Creatining bridge br01 on F33 Beta L1 KVM Guest
$ nmcli connection add ifname br01 type bridge con-name br01
$ nmcli connection add type bridge-slave ifname  enp1s0 master br01
$ sudo nmcli con modify br01 bridge.stp no
$ sudo reboot
Bridge br01 to virtual network interface has been created.

Now deploying F33 Beta L2 Guest via shared device br01
F33 Beta L2 Guest has been deployed



Surfing the Net from F33 Beta L2 Guest . Taskbar at the bottom of snapshot belongs to Server Fedora 32 (bare metal) with Deepin desktop as administrative console



Connection via ssh from office LAN to F33 Beta L2 KVM Guest



References










Sunday, September 27, 2020

Setting up Virtual Box on SparkyLinux 2020.09

Following below is a brief "howto" succeed with mentioned installation on SparkyLinux 2020.09 in meantime

After initial roll forward and reboot make sure that grub entry been used was 


Afterwards proceed as follows

boris@boris-ms7c42:~$ sudo apt install build-essential linux-headers-amd64

Previous install would allow us to perform successful installation like it's officially suggested on Ubuntu 20.04

boris@boris-ms7c42:~$ sudo apt install virtualbox

Reading package lists... Done

Building dependency tree       

Reading state information... Done

The following packages were automatically installed and are no longer required:

  libcdio18 libilmbase24 liblivemedia79 libmicrodns0 libopenexr24 libpoppler82 libpoppler95

  linux-image-5.7.0-2-amd64 linux-image-5.7.0-3-amd64

Use 'sudo apt autoremove' to remove them.

The following additional packages will be installed:

  libgsoap-2.8.104 liblzf1 libvncserver1 virtualbox-dkms virtualbox-qt

Suggested packages:

  vde2 virtualbox-guest-additions-iso

The following NEW packages will be installed:

  libgsoap-2.8.104 liblzf1 libvncserver1 virtualbox virtualbox-dkms virtualbox-qt

0 upgraded, 6 newly installed, 0 to remove and 0 not upgraded.

Need to get 44,0 MB of archives.

After this operation, 176 MB of additional disk space will be used.

Do you want to continue? [Y/n] Y

Get:1 http://deb.debian.org/debian bullseye/main amd64 libgsoap-2.8.104 amd64 2.8.104-2 [283 kB]

Get:2 http://deb.debian.org/debian bullseye/main amd64 liblzf1 amd64 3.6-2 [9 896 B]

Get:3 http://deb.debian.org/debian bullseye/main amd64 libvncserver1 amd64 0.9.13+dfsg-1 [232 kB]

Get:4 https://repo.sparkylinux.org potolo/main amd64 virtualbox-dkms amd64 6.1.14-dfsg-3 [722 kB]

Get:5 https://repo.sparkylinux.org potolo/main amd64 virtualbox amd64 6.1.14-dfsg-3 [21,3 MB]

Get:6 https://repo.sparkylinux.org potolo/main amd64 virtualbox-qt amd64 6.1.14-dfsg-3 [21,5 MB]

Fetched 44,0 MB in 30s (1 473 kB/s)                                                             

Selecting previously unselected package libgsoap-2.8.104:amd64.

(Reading database ... 259744 files and directories currently installed.)

Preparing to unpack .../0-libgsoap-2.8.104_2.8.104-2_amd64.deb ...

Unpacking libgsoap-2.8.104:amd64 (2.8.104-2) ...

Selecting previously unselected package liblzf1:amd64.

Preparing to unpack .../1-liblzf1_3.6-2_amd64.deb ...

Unpacking liblzf1:amd64 (3.6-2) ...

Selecting previously unselected package libvncserver1:amd64.

Preparing to unpack .../2-libvncserver1_0.9.13+dfsg-1_amd64.deb ...

Unpacking libvncserver1:amd64 (0.9.13+dfsg-1) ...

Selecting previously unselected package virtualbox-dkms.

Preparing to unpack .../3-virtualbox-dkms_6.1.14-dfsg-3_amd64.deb ...

Unpacking virtualbox-dkms (6.1.14-dfsg-3) ...

Selecting previously unselected package virtualbox.

Preparing to unpack .../4-virtualbox_6.1.14-dfsg-3_amd64.deb ...

Unpacking virtualbox (6.1.14-dfsg-3) ...

Selecting previously unselected package virtualbox-qt.

Preparing to unpack .../5-virtualbox-qt_6.1.14-dfsg-3_amd64.deb ...

Unpacking virtualbox-qt (6.1.14-dfsg-3) ...

Setting up libvncserver1:amd64 (0.9.13+dfsg-1) ...

Setting up liblzf1:amd64 (3.6-2) ...

Setting up libgsoap-2.8.104:amd64 (2.8.104-2) ...

Setting up virtualbox-dkms (6.1.14-dfsg-3) ...

Loading new virtualbox-6.1.14 DKMS files...

Building for 5.8.0-2-amd64

Building initial module for 5.8.0-2-amd64

Done.

vboxdrv.ko:

Running module version sanity check.

 - Original module

   - No original module exists within this kernel

 - Installation

   - Installing to /lib/modules/5.8.0-2-amd64/updates/

vboxnetadp.ko:

Running module version sanity check.

 - Original module

   - No original module exists within this kernel

 - Installation

   - Installing to /lib/modules/5.8.0-2-amd64/updates/

vboxnetflt.ko:

Running module version sanity check.

 - Original module

   - No original module exists within this kernel

 - Installation

   - Installing to /lib/modules/5.8.0-2-amd64/updates/

depmod......

DKMS: install completed.

Setting up virtualbox (6.1.14-dfsg-3) ...

Created symlink /etc/systemd/system/multi-user.target.wants/vboxweb.service → /lib/systemd/system

/vboxweb.service.

Job for vboxweb.service failed because the service did not take the steps required by its unit co

nfiguration.

See "systemctl status vboxweb.service" and "journalctl -xe" for details.

Setting up virtualbox-qt (6.1.14-dfsg-3) ...

Processing triggers for menu (2.1.47+b1) ...

Processing triggers for desktop-file-utils (0.26-1) ...

Processing triggers for mime-support (3.64) ...

Processing triggers for hicolor-icon-theme (0.17-2) ...

Processing triggers for libc-bin (2.31-3) ...

Processing triggers for systemd (246.6-1) ...

Processing triggers for man-db (2.9.3-2) ...

Processing triggers for shared-mime-info (1.15-1) ...

boris@boris-ms7c42:~$ which virtualbox

/usr/bin/virtualbox

Now start standard deploying Ubuntu 20.04.1 Guest via virtual box














When done follow known guide lines see http://lxer.com/module/newswire/view/291286/index.html













































Final verification that VM's window is re-sizable  








 











Friday, September 25, 2020

Setting up Sqlite3 Python embedded database and Sqlitebrowser on Virtual Box CentOS 8.2 VM

 Proceed with normal VM's install via CentOS-8.2.2004-x86_64-minimal.iso in Virtual Box 6.1.X. Notice that same straight forward install from scratch of Sqlite3 database would work on bare metal as well . Just no VBoxLinuxAdditions.run related commands.

 When done :-

   $ uname -a

  $ sudo dnf update -y

   $ sudo reboot

   $ sudo dnf install sqlite-devel qt5-* -y

   $ rpm -q sqlite-devel

   $ sudo dnf install wget

   $ wget https://www.python.org/ftp/python/3.8.5/Python-3.8.5.tgz

   $ sudo dnf groupinstall "Development Tools" -y

   $ tar xvf Python-3.8.5.tgz

   $  cd *.5

   $ ./configure --enable-optimizations

   $  sudo make altinstall

   $ python3.8

Python 3.8.5 (default, Sep 25 2020, 13:57:55) 

[GCC 8.3.1 20191121 (Red Hat 8.3.1-5)] on linux

Type "help", "copyright", "credits" or "license" for more information.

>>> import sqlite3

>>> 

   $ cd

   $ git clone https://github.com/sqlitebrowser/sqlitebrowser

   $ cd sql*

   $ cmake -Wno-dev .

   $ make

   $ sudo make install

   $ sudo reboot

   $ sudo dnf groupinstall "Server with GUI" -y

   $ sudo systemctl set-default graphical.target

   $ sudo shutdown -P now

   *************************************************

   Dismount CentOS-8.2.2004-x86_64-minimal.iso and

   mount VBox_GAs_6.1.14

   ************************************************

   $ df -h

   $  sudo dnf install epel-release

   $  sudo dnf install gcc make perl kernel-devel kernel-headers bzip2 dkms

   $   rpm -q kernel-devel

   $  uname -r

   $  sudo dnf update kernel-*

   # df -h

   # cd /run/media/boris/VBox_GAs_6.1.14

   # ./VBoxLinuxAdditions.run 

   

Shutdown VM and start it again

























Saturday, September 19, 2020

Install Ubuntu 20.04.1 as Virtual Box Guest on Fedora 32 Server

First follow https://computingforgeeks.com/how-to-install-vagrant-and-virtualbox-on-fedora/  Per standard procedure deploy Ubuntu Virtual Box Guest via local ISO image. Right after logging into newly created instance run :-

$ sudo apt install build-essential dkms linux-headers-$(uname -r)

Then Goto Menu option "Devices" and select from drop down list "Insert Guest =>Additions CD Image" . Perform actions requested by raised up window. Shutdown Ubuntu instance and start again to be able scale guest window as advised in video

https://www.youtube.com/watch?v=x5MhydijWmc


$ sudo dnf update -y ;  $ sudo shutdown -P now

Attach to F32 VM VBoxGuestAdditions_6.1.14.iso. Start up VM

Index of /virtualbox/6.1.14

  $ sudo dnf install kernel-headers kernel-devel make

  Copy content of DVD attached  to /root/VBoxGuestAdditions  as root

  # cd  

  # cd VBoxGuestAdditions 

  # ./VBoxLinuxAdditions.ru

  
Shutdown F32 Guest and start again


Two VMs running at a time


Monday, September 14, 2020

Install CentOS 8.2 KVM Guest on SparkyLinux2020.09 via Web Cockpit Console

First notice that we are installing on Ryzen box with board MSI X570 A-PRO in UEFI mode with "kvm" enabled.
First of all we intend to verify that kvm has been enabled 
   $ dmesg | grep kvm
   [ 4.376968] kvm: Nested Virtualization enabled
   [ 4.376978] SVM: kvm: Nested Paging enabled
and proceed with installing Virtualization Host the same way we
would do it on Debian “bullseye”


 $ sudo apt install qemu-kvm  libvirt-daemon bridge-utils \
         virtinst libvirt-daemon-system -y
 $ sudo apt install virt-top libguestfs-tools libosinfo-bin \
       qemu-system virt-manager -y
 $  sudo modprobe vhost_net 
 $  lsmod | grep vhost
 $  echo vhost_net | sudo tee -a /etc/modules
 $  sudo reboot


  It's nice to have virt-manager installed ( Spice console ) but presence of Web Cockpit Console is quite enough to manage guest's deployment via clicking  button "Remote Virt-viewer"  built into Cockpit Web Console. Bridge attached to external network interface was also created pretty  smoothly utilizing network management section inside Web Console.

Install Web Cockpit Console  

 $  sudo apt install cockpit cockpit-machines
 $  sudo systemctl start cockpit.socket
 $  sudo systemctl enable cockpit.socket

 Tuning firewall

 $  sudo apt install firewalld
 $  sudo firewall-cmd --add-service=cockpit --permanent
 $  sudo firewall-cmd --reload



Logging into Console at port 9090 and proceed as follows







    Deployment Ubuntu 20.04.1 kvm guest in the same       
    environment


Saturday, September 12, 2020

Setting up Sqlite3 Python embedded database and Sqlitebrowser on CentOS 8.2

**************************************************************
UPDATE 09/25/2020
The most recent updates to CentOS 8.2 Repos makes qt5-devel unavailable,  so setup Qt5 has been updated correspondingly
Please, don't be hesitant to use "--skip broken" it might be required in case if you installed from complete DVD version (USB stick) and keep system in up to date shape. When install has been done from minimal DVD install qt5-* and afterwards $ dnf group install "Server with GUI" . See also Setting up Sqlite3 Python embedded database and Sqlitebrowser on Virtual Box CentOS 8.2 VM
**************************************************************
First instatll "Development Tools", rebuild Python 3.8.5
after installation sqlite-devel. Afterwards build sqlitebrowser from source rather then install via snap, qt5-* packages would have to be installed for successful build on CentOS 8.2.

$ sudo dnf groupinstall "Development Tools" -y
$ sudo dnf install sqlite-devel

Rebuild Python

$cd ; $ cd ./Python-3.8.5
$ ./configure —enable-optimizations
$ sudo make altinstall

Prepare to build sqlitebrowser which wouldn't
have any issues with Qt vs the one provided via snap

$ sudo dnf install qt5-* or $ sudo dnf install qt5-* --skip-broken
$ git clone https://github.com/sqlitebrowser/sqlitebrowser
$ cd sqlitebrowser
$ cmake -Wno-dev .
$ make
$ sudo make install



[boris@Server82 sqlitebrowser]$ file sqlitebrowser
sqlitebrowser: ELF 64-bit LSB executable, x86-64, version 1 (GNU/Linux), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 3.2.0, BuildID[sha1]=94852e47e12ccdf516d4a1194083745885911192, not stripped

Make sure
[boris@Server82 ~]$ python3.8
Python 3.8.5 (default, Sep 11 2020, 12:09:30)
[GCC 8.3.1 20191121 (Red Hat 8.3.1-5)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import sqlite3
>>>


Now follow for instance sqlite3 – Embedded Relational Database and see that basic DDL && DML operations work with no problems via Python API . However, Encrypting would require Python 2.7. Just one sample :-

[boris@Server82 DB]$ python3.8 sqlite3_create_function.py
Original values:
(1, 'write about select')
(2, 'write about random')
(3, 'write about sqlite3')
(4, 'finish reviewing markup')
(5, 'revise chapter intros')
(6, 'subtitle')

Encrypting...
Encrypting 'write about select'
Traceback (most recent call last):
  File "sqlite3_create_function.py", line 29, in <module>
    cursor.execute(query)
sqlite3.OperationalError: user-defined function raised exception

[boris@Server82 DB]$ python2.7
bash: python2.7: command not found...
Install package 'python2' to provide command 'python2.7'? [N/y] y

 * Waiting in queue... 
 * Loading list of packages.... 
The following packages have to be installed:
 python2-2.7.17-1.module_el8.2.0+381+9a5b3c3b.x86_64 An interpreted, interactive, object-oriented programming language
 python2-libs-2.7.17-1.module_el8.2.0+381+9a5b3c3b.x86_64 Runtime libraries for Python 2
 python2-pip-9.0.3-16.module_el8.2.0+381+9a5b3c3b.noarch A tool for installing and managing Python 2 packages
 python2-pip-wheel-9.0.3-16.module_el8.2.0+381+9a5b3c3b.noarch The pip wheel
 python2-setuptools-39.0.1-11.module_el8.2.0+381+9a5b3c3b.noarch Easily build and distribute Python packages
 python2-setuptools-wheel-39.0.1-11.module_el8.2.0+381+9a5b3c3b.noarch The setuptools wheel
Proceed with changes? [N/y] y

 * Waiting in queue... 
 * Waiting for authentication... 
 * Waiting in queue... 
 * Downloading packages... 
 * Requesting data... 
 * Testing changes... 
 * Installing packages... 

[boris@Server82 DB]$ python2.7 sqlite3_create_function.py
Original values:
(1, u'write about select')
(2, u'write about random')
(3, u'write about sqlite3')
(4, u'finish reviewing markup')
(5, u'revise chapter intros')
(6, u'subtitle')

Encrypting...
Encrypting u'write about select'
Encrypting u'write about random'
Encrypting u'write about sqlite3'
Encrypting u'finish reviewing markup'
Encrypting u'revise chapter intros'
Encrypting u'subtitle'

Raw encrypted values:
(1, u'jevgr nobhg fryrpg')
(2, u'jevgr nobhg enaqbz')
(3, u'jevgr nobhg fdyvgr3')
(4, u'svavfu erivrjvat znexhc')
(5, u'erivfr puncgre vagebf')
(6, u'fhogvgyr')

Decrypting in query...
Decrypting u'jevgr nobhg fryrpg'
Decrypting u'jevgr nobhg enaqbz'
Decrypting u'jevgr nobhg fdyvgr3'
Decrypting u'svavfu erivrjvat znexhc'
Decrypting u'erivfr puncgre vagebf'
Decrypting u'fhogvgyr'
(1, u'write about select')
(2, u'write about random')
(3, u'write about sqlite3')
(4, u'finish reviewing markup')
(5, u'revise chapter intros')
(6, u'subtitle')



   Switching to Xorg when logging in
 

    Verification sqlite database version