Monday, April 03, 2017

Using CAC with KVM/QEMU and remote viewer

To use a SmartCard or CAC with kvm/qemu, you'll need to install remote-viewer on the machine that will run remote-viewer to connect to the remote VM. The VM will need the Smartcard hardware installed and set to Passthrough. A CCID controller will be required as well.

The command to connect to the VM with the smartcard is

remote-viewer --spice-smartcard spice://<ip or hostname of VM host>:5900

Sunday, February 26, 2017

Nouveau Fedora Dell 6520

I have a Dell E6520 personal laptop. It's old and I've had problems with the Nouveau and Nvidia GPU. With the update to Fedora 25 and Wayland, I started having more random lockups. I had disabled hardware video acceleration in Chrome, but that wasn't fixing the issue. I finally decided to lookup disabling Wayland and video acceleration. To disable Wayland, edit /etc/gdm/custom.conf:
[daemon]
# Uncoment the line below to force the login screen to use Xorg
WaylandEnable=false
To disable nouveau acceleration, edit /etc/default/grub
GRUB_CMDLINE_LINUX="rhgb quiet nouveau.noaccel=1"
Run the grub2-mkconfig command:
sudo grub2-mkconfig --output="/boot/grub2/grub.cfg

Tuesday, January 24, 2017

Intel AMT Serial Over LAN

Quick post about what I needed to do to get Serial Over Lan (SOL) working on an HP z420 workstation. This machine has a Xeon processor. Sincce there's no integrated graphics, the KVM capaability of Intel vPro/AMT doesn't work. Modify /etc/default/grub and add the following two lines at the end fo the file.
GRUB_CMDLINE_LINUX="console=tty0 console=ttyS4,115200n8"
GRUB_SERIAL_COMMAND="serial --speed=115200 --port=0xe060 --word=8 --parity=no --stop=1"
Create the file /etc/systemd/system/serial-getty@ttyS4.service with the following contents.
#  This file is part of systemd.
#
#  systemd is free software; you can redistribute it and/or modify it
#  under the terms of the GNU Lesser General Public License as published by
#  the Free Software Foundation; either version 2.1 of the License, or
#  (at your option) any later version.

[Unit]
Description=Serial Getty on %I
Documentation=man:agetty(8) man:systemd-getty-generator(8)
Documentation=http://0pointer.de/blog/projects/serial-console.html
BindsTo=dev-%i.device
After=dev-%i.device systemd-user-sessions.service plymouth-quit-wait.service
After=rc-local.service

# If additional gettys are spawned during boot then we should make
# sure that this is synchronized before getty.target, even though
# getty.target didn't actually pull it in.
Before=getty.target
IgnoreOnIsolate=yes

[Service]
ExecStart=-/sbin/agetty --keep-baud 115200 %I vt100-nav 
Type=idle
Restart=always
UtmpIdentifier=%I
TTYPath=/dev/%I
TTYReset=yes
TTYVHangup=yes
KillMode=process
IgnoreSIGPIPE=no
SendSIGHUP=yes

[Install]
WantedBy=getty.target
Enable the ttyS4 getty in systemctl with command below.
systemctl enable serial-getty@ttyS4.service
Reboot your machine. You should be able to use SOl via the following command. There will be a prompt for the AMT password. This was set in your BIOS.
amtterm host or ip address
Check the status of the getty
systemctl status serial-getty@ttyS4.service

Sunday, January 08, 2017

Opensource Software Waivers and the U.S. Government

Opensource software waivers are a joke. It may take many months or even a year or more to get the software approved. It may only be for a specific version of the software as well. So, when you do get the software approved you may not be able to use the latest with whatever security patches that have been approved. If anything, the process and bureaucracy are making the their organizations more insecure.

Saturday, December 31, 2016

Ansible Waiting for VM shutdown

I've been using Ansible for the past 8 months for a web application. Recently I needed a way to wait for the VM to shutdown. The solution I ended up using is the following. Essentially it's a script that greps the virtual machine list until the virtual machine name does not show up.
  - name: wait for the VM to shutdown
    shell:  while [[ `virsh list | grep {{ vmimage }} ` ]]; do sleep 1; done; exit 0
    poll: 3
If I want to start a VM and wait for it to become ready, I use a wait_for to wait for ssh to respond. There's probably a better way to do this.
  - name: wait for vm ssh to start
    wait_for:  host={{ vmhostname}} port=22 state=present delay=10 connect_timeout=3

Not Dead

This is site isn't dead, just slumbering. I'm thinking about moving a bunch of links that I've posted on another social media site here just to make them easier to find.

Thursday, October 25, 2012

Mono CSC.exe and HASH_SET error

I fought this error until I found the magic incantation that would work on google. It's a known bug with the 2.6.x mono release.
C:\PROGRA~2\MONO-2~1.7\lib\mono\3.5\Microsoft.CSharp.targets: error : 
Error executing tool 'C:\PROGRA~2\MONO-2~1.7\bin\gmcs': 
ApplicationName='C:\PROGRA~2\MONO-2~1.7\bin\gmcs', CommandLine='/noconfig @C:\Temp\tm
p46ea550.tmp', CurrentDirectory='c:\working\ITAEngine\ITAEngine'
        Task "Csc" execution -- FAILED
        Done building target "CoreCompile" in project "c:\working\working.csproj".-- FAILED
The fix is to add /p:CscToolExe=gmcs.bat to the xbuild command line.
c:\working>xbuild /p:Configuration=Release /p:CscToolExe=gmcs.bat working.csproj
Another problem is the HASH_SET wasn't being detected which requires a new Reference. in the ItemGroup The error:
FileManager.cs(17,25): error CS0246: The type or namespace name `HashSet`1' could not be found. Are you missing a using directive or an assembly reference?
        Task "Csc" execution -- FAILED
        Done building target "CoreCompile" in project "c:\working\working.csproj".-- FAILED

The fix to include in the csproj is:

<Reference Include="System.Core" />