Skip to content

Instantly share code, notes, and snippets.

@kurtis318
kurtis318 / find_guest_ips_using_virsh.md
Last active May 26, 2020 20:33
Finding KVM guest IPs using virsh command

The following works all the time.

REF: https://adam.younglogic.com/2017/10/vm-ip-virsh/

I presume the VM should be up and running for the following commands to work.

HOSTNAME="rhel75"
MAC=$(virsh domiflist $HOSTNAME | awk '{ print $5 }'| tail -2 | head -1)
arp -a | grep $MAC | awk '{ print $2 }' | sed 's/[()]//g'
@kurtis318
kurtis318 / fix_remmina_vnc_sessions_start_then_exit_immediately.txt
Created May 11, 2018 18:24
Fix for remmina vnc sessions starting then ending immediately (Linux).
REF: https://github.com/FreeRDP/Remmina/issues/699
POST: antenore commented on Dec 17, 2015
I configure a VNC session for a Linux host/guest. When I open it from remmina, the window shows up and then closes immediately.
The solution is to use a color depth of "True Color (24bpp)". I was using 256 colors (8 bit), High Color (15 & 16 bpp) and these
resulted in immediate window closure. The True Color depth worked the first time. Might be a product of latest Linux distros.
@kurtis318
kurtis318 / Force_ssh_client_to_use_password.txt
Created May 8, 2018 15:18
Force ssh client to use password
REF: https://makandracards.com/makandra/1326-force-ssh-client-to-use-password-authentication-instead-of-public-key
I was having trouble remembering the password in order to use ssh-copy-id command. The above site had the solution. Bless you.
ssh -o PreferredAuthentications=password -o PubkeyAuthentication=no user@host
@kurtis318
kurtis318 / Getting_shared_folders_working_on_Win10_host_Fedora_27_guest.txt
Created April 15, 2018 21:31
Getting shared folders working on Win10 host Fedora 27 guest
I am using the latest VirtualBox on my Dell XPS 13 and I had a Fedora 27 guest that I could not get the shared folder to mount in the guest. I got errors indicating a permissions problem and another about a protocol error.
I finally got the Fedora 27 guest OS to properly mount my Win10 user home directory (C:\Users\Kurtis) by doing the following steps:
1. Run this command on the Fedora 27 guest replacing the userid kurtis : sudo usermod -a -G vboxfs kurtis
If you get an error, the VirtualBox guest extension are probably not installed. They must be installed.
2. Shut down the Fedora 27 guest OS.
3. Remove the shared folder using the main VirtualBox client (the one that lets you configure new or edit existing guests).
4. Re-add the shared folder using the main VIrtualBox client.
5. Start Fedora 27 guest and log in.
@kurtis318
kurtis318 / How-to_get_rid_of_virbr0_and_or_virbr1_in_KVM_guests.txt
Created April 12, 2018 14:31
How-to get rid of virbr0 and or virbr1 in KVM guests
I have installed some RHEL 7.4 that were custom built by someone. They were intended for a bare-metal OS so they
have full virtualization enabled. This means libvirtd is automatically started and there are virbr0 and sometimes virbr1
bridges enabled. This usually causes the KVM guest to not have any access to any network via NAT because the bridges
are trying to route all traffic.
Here is a website I found that I found useful:
https://www.cyberciti.biz/faq/linux-kvm-disable-virbr0-nat-interface/
The following commands will probably work to disable the two bridged networks.
@kurtis318
kurtis318 / Fixing_Microsoft_Store_on_Win10.txt
Created April 10, 2018 14:38
Fixing Microsoft Store on Win10
My Windows 10 VM had a broken Microsoft Store link in the Start menu. The link was renamed to ms-resource:StoreTitle
instead of Microsoft Store.
I found the following reddit post that fixed the icon.
https://www.reddit.com/r/Windows10/comments/82h48u/announcing_windows_10_insider_preview_build_17115/
Summary is as follows:
Open a powershell console as admin user. Run the commands:
@kurtis318
kurtis318 / Solution_for_upgrade_to_ownCloud_10.0.0.7_and_missing_php_intl_module.txt
Last active April 4, 2018 05:21
Solution for upgrade to ownCloud 10.0.0.7 and missing php intl module
I have ownCloud running on a Cent OS7 machine. Somehow, I am using php 5.6.18 instead of php 7.0 or later.
I got the php 5.6.18 from some awkward repos other people maintain (probably not a good idea, I should change this).
When I did a yum update, a new version of ownCloud got installed. When I opened my ownCloud home page I got greeted
not with the normal login page for ownCloud. Instead of a userid/password prompt, I got two messages about not
being able to load php module (I knew I should have saved the exact error messages).
After bit of Googling, I found a solution.
@kurtis318
kurtis318 / Win10_fix_for_no_wifi_networks.txt
Created March 20, 2018 04:04
Win10 fix for no wifi networks.
I just got a refurbished Dell XPS 13 (9360) about a week ago. All was going good until yesterday when I noticed
that there were no longer any wireless networks available when I tried to connect. I checked device manager and
the "Killer Wireless-n/a/ac 1535 Wireless Network Adapter" had an X in the icon indicating it had failed. Removing
the device (not deleting the driver) and rebooting fixed the driver error BUT there were still no wifi networks
showing when I clicked the Network icon in the tray.
After a bit of Googling, I finally ran into the following article:
https://www.drivereasy.com/knowledge/solved-wifi-network-not-showing-up-on-computer/
@kurtis318
kurtis318 / Keep_kernel_forever_on_Fedora.txt
Created March 8, 2018 06:05
Keep kernel forever on Fedora
I was having trouble with Fedora 27 and kernels newer than 4.15.3-300 booting
my Lenovo P50. I have a 4.15.3-300 kernel that does not hang on boot.
I did some Googling and found a way to keep the 4.15.3-300 from being
automatically deleted va dnf.
REF:
https://ask.fedoraproject.org/en/question/37532/how-to-tell-yum-to-keep-an-old-kernel-when-updating-the-kernel/
@kurtis318
kurtis318 / Windows_10_netstat_command_tips.txt
Created March 6, 2018 05:13
Windows 10 netstat command tips
REF: http://mikefrobbins.com/2011/03/31/filter-results-by-piping-output-to-the-find-command/
Surface@SURFACEPRO2 C:\Users\Surface
> netstat -an -p TCP | find /I "listening"
TCP 0.0.0.0:135 0.0.0.0:0 LISTENING
TCP 0.0.0.0:445 0.0.0.0:0 LISTENING
TCP 0.0.0.0:515 0.0.0.0:0 LISTENING
TCP 0.0.0.0:3389 0.0.0.0:0 LISTENING
TCP 0.0.0.0:5357 0.0.0.0:0 LISTENING