Wednesday, December 28, 2016

cloning a qemu VM and removing old details present in clone



Cloning the vm:

First clone the VM using virt-manager UI. (launch # sudo virt-manager, the click on the VM to clone, and right click and select clone).

Assign a new name while cloning.

Ensure the new VM is shutdown and then run virt-sysprep as follows

Then, use virt-sysprep as follows:

virt-sysprep -d <new name of clone> --hostname <new hostname> --root-password password:<new root password>

Here,
-d => decontextualize

Look at man virt-sysprep for more options available.

-------------------
How do you get new name of the clone?

It is the name field available in the xml file.
-------------------

Example:
# virt-sysprep -d node2  --hostname node2 --root-password password:testpassword  
[   0.0] Examining the guest ...
[   2.8] Performing "abrt-data" ...
[   2.8] Performing "bash-history" ...
[   2.8] Performing "blkid-tab" ...
[   2.8] Performing "crash-data" ...
[   2.8] Performing "cron-spool" ...
[   2.8] Performing "dhcp-client-state" ...
[   2.8] Performing "dhcp-server-state" ...
[   2.8] Performing "dovecot-data" ...
[   2.8] Performing "logfiles" ...
[   2.9] Performing "machine-id" ...
[   2.9] Performing "mail-spool" ...
[   2.9] Performing "net-hostname" ...
[   2.9] Performing "net-hwaddr" ...
[   2.9] Performing "pacct-log" ...
[   2.9] Performing "package-manager-cache" ...
[   2.9] Performing "pam-data" ...
[   2.9] Performing "puppet-data-log" ...
[   2.9] Performing "rh-subscription-manager" ...
[   2.9] Performing "rhn-systemid" ...
[   2.9] Performing "rpm-db" ...
[   2.9] Performing "samba-db-log" ...
[   2.9] Performing "script" ...
[   2.9] Performing "smolt-uuid" ...
[   2.9] Performing "ssh-hostkeys" ...
[   2.9] Performing "ssh-userdir" ...
[   2.9] Performing "sssd-db-log" ...
[   2.9] Performing "tmp-files" ...
[   2.9] Performing "udev-persistent-net" ...
[   2.9] Performing "utmp" ...
[   2.9] Performing "yum-uuid" ...
[   2.9] Performing "customize" ...
[   2.9] Setting a random seed
[   2.9] Setting the hostname: node2
[   2.9] Setting passwords
[   4.9] Performing "lvm-uuids" ...

=======================================



Friday, December 16, 2016

disable automount/running programs on media insertion - fedora 22



To disable any automounting / running program when android mobile(or any media) is inserted:

Window -> type "Details" -> "removable media"  -> check "Never prompt or start programs on media insertion"


Wednesday, December 7, 2016

sourcing vs executing a script

source a script vs executing(or running) a script, what is the difference?

short:
sourcing will run the commands in the current shell process. executing will run the commands in a new shell process.

long:
sourcing :
Sourcing the script does not create a new shell. All commands are run in the current shell and changes to the environment take effect in the current shell.

It's as if you typed the contents of the script.

 running:
The changes were made in a new shell. The current shell spawned a new shell to run the script. The script is running in the new shell and all changes to the environment take effect in the new shell. After the script is done the new shell is destroyed. All changes to the environment in the new shell are destroyed with the new shell. Only the output text is printed in the current shell.




link :
http://superuser.com/questions/176783/what-is-the-difference-between-executing-a-bash-script-and-sourcing-a-bash-scrip

 

Sunday, December 4, 2016

failed to find romfile "efi-virtio.rom" - qemu failed to start - solution


Started facing this error:
# virsh create centos7.0.xml
error: Failed to create domain from centos7.0.xml
error: internal error: process exited while connecting to monitor: 2016-12-04T16:20:01.524386Z qemu-system-x86_64: -device virtio-net-pci,netdev=hostnet0,id=net0,mac=52:54:00:2e:7b:93,bus=pci.0,addr=0x3: failed to find romfile "efi-virtio.rom"
2016-12-04T16:20:01.524477Z qemu-system-x86_64: -device virtio-net-pci,netdev=hostnet0,id=net0,mac=52:54:00:2e:7b:93,bus=pci.0,addr=0x3: Device 'virtio-net-pci' could not be initialized

Then fixed all the links of rom files as below:

root@gant qemu$ ls -l efi*.rom
lrwxrwxrwx 1 root root 24 Jun 22 20:08 efi-e1000.rom -> ../ipxe.efi/8086100e.rom
lrwxrwxrwx 1 root root 24 Jun 22 20:08 efi-ne2k_pci.rom -> ../ipxe.efi/10ec8029.rom
lrwxrwxrwx 1 root root 24 Jun 22 20:08 efi-pcnet.rom -> ../ipxe.efi/10222000.rom
lrwxrwxrwx 1 root root 24 Jun 22 20:08 efi-rtl8139.rom -> ../ipxe.efi/10ec8139.rom
lrwxrwxrwx 1 root root 24 Jun 22 20:08 efi-virtio.rom -> ../ipxe.efi/1af41000.rom
root@gant qemu$
root@gant qemu$
root@gant qemu$ ln -sf   ../ipxe/8086100e.rom efi-e1000.rom
root@gant qemu$ ln -sf   ../ipxe/10ec8029.rom efi-ne2k_pci.rom
root@gant qemu$ ln -sf ../ipxe/10222000.rom efi-pcnet.rom
root@gant qemu$ ln -sf  ../ipxe/10ec8139.rom efi-rtl8139.rom
root@gant qemu$ ln -sf  ../ipxe/1af41000.rom efi-virtio.rom
root@gant qemu$
root@gant qemu$ ls -l efi*.rom
lrwxrwxrwx 1 root root 20 Dec  4 22:32 efi-e1000.rom -> ../ipxe/8086100e.rom
lrwxrwxrwx 1 root root 20 Dec  4 22:32 efi-ne2k_pci.rom -> ../ipxe/10ec8029.rom
lrwxrwxrwx 1 root root 20 Dec  4 22:32 efi-pcnet.rom -> ../ipxe/10222000.rom
lrwxrwxrwx 1 root root 20 Dec  4 22:32 efi-rtl8139.rom -> ../ipxe/10ec8139.rom
lrwxrwxrwx 1 root root 20 Dec  4 22:32 efi-virtio.rom -> ../ipxe/1af41000.rom
root@gant qemu$


Saturday, December 3, 2016

பாரதி பாடல் - சின்னஞ் சிறு கிளியே

சின்னஞ் சிறு கிளியே - கண்ணம்மா! 
செல்வக் களஞ்சியமே! 
என்னைக் கலி தீர்த்தே - உலகில் 
ஏற்றம் புரிய வந்தாய்! 
பிள்ளைக் கனியமுதே - கண்ணம்மா 
பேசும்பொற் சித்திரமே! 
அள்ளி யணைத்திடவே - என் முன்னே 
ஆடி வருந்தேரே ! 

ஓடி வருகையில் - கண்ணம்மா 
உள்ளங் குளிரு தடீ! 
ஆடித்திரிதல் கண்டால் - உன்னைப்போய் 
ஆவி தழுவு தடீ! 
உச்சி தனை முகந்தால் - கருவம் 
ஓங்கி வளரு தடீ! 
மெச்சி யுனை யூரார் - புகழ்ந்தால் 
மேனி சிலிர்க்கு தடீ! 

கன்னத்தில் முத்தமிட்டால் - உள்ளந்தான் 
கள்வெறி கொள்ளு தடீ! உன்னைத் தழுவிடிலோ - கண்ணம்மா 
உன்மத்த மாகு தடீ! 
சற்றுன் முகஞ் சிவந்தால் - மனது 
சஞ்சல மாகு தடீ! 
நெற்றி சுருங்கக் கண்டால் - எனக்கு 
நெஞ்சம் பதைக்கு தடீ! 

உன்கண்ணில் நீர்வழிந்தால் - என்நெஞ்சில் 
உதிரங் கொட்டு தடீ! 
என் கண்ணிற் பாவையன்றோ? - கண்ணம்மா! 
என்னுயிர் நின்ன தன்றோ? 
சொல்லு மழலையிலே - கண்ணம்மா! 
துன்பங்கள் தீர்த்திடு வாய்; 
முல்லைச் சிரிப்பாலே - எனது 
மூர்க்கந் தவிர்த்திடு வாய். 

இன்பக் கதைக ளெல்லாம் - உன்னைப்போல் 
ஏடுகள் சொல்வ துண்டோ? 
அன்பு தருவதிலே - உனைநேர் 
ஆகுமோர் தெய்வ முண்டோ? 
மார்பில் அணிவதற்கே -உன்னைப்போல் 
வைர மணிக ளுண்டோ? 
சீர்பெற்று வாழ்வதற்கே -உன்னைப் போல் 
செல்வம் பிறிது முண்டோ?


// என்னைக் கலி தீர்த்தே - எனது துன்பங்களையெல்லாம் ஒழித்து


Note:

Updated.
இருந்தபோதிலும், இதில் எழுத்து பிழை இருக்க வாய்ப்பு உள்ளது.
பாரதியார் புத்தகத்தில் பிழையற்ற பாடல் இருக்கும்.

இதை  பார்வைக்கு  மட்டுமே பயன்படுத்தவும்.
நன்றி!