#!/usr/bin/bash
rm -rf *.gz
rm -rf *.zip
if [ -f /var/sadm/install/.lockfile ] ; then
echo "sadm pkgadd lockfile present"
read -r -p "delete? [y/N] " response
case $response in
[yY][eE][sS]|[yY])
rm -rf /var/sadm/install/.lockfile
;;
*)
quit
;;
esac
fi
if [ -f /tmp/.ai.pkg.zone.lock-* ] ; then
echo "zone pkgadd lockfile present"
read -r -p "delete? [y/N] " response
case $response in
[yY][eE][sS]|[yY])
rm -rf /tmp/.ai.pkg.zone.lock-*
;;
*)
quit
;;
esac
fi
if [ -f /var/sadm/install/.pkg.lock ] ; then
echo "pkgadd lockfile present"
read -r -p "delete? [y/N] " response
case $response in
[yY][eE][sS]|[yY])
rm -rf /var/sadm/install/.pkg.lock
;;
*)
quit
;;
esac
fi
for i in *local; do pkgadd -d $i; done
Monday, January 18, 2016
recursive pkgadd on solaris10 zone
Monday, January 11, 2016
vcenter 5.5 root password hijinx
this:




Also when I connected with SSH to the Appliance I’m getting error messages that my password is not correct.
I know for sure that this password is the correct one. I opened a console screen from the vSphere Webclient and that one is also giving me the error.
Also the VMware vSphere Web Client is giving an error.
I am unable to logon with the root account of the appliance.
Ok.. This is a problem. I remembered reading a blog post of William Lam about a problem with the expiration date of the Root Password. So I started searching the VirtualGhetto blog site, and found the article. See http://www.virtuallyghetto.com/2013/09/how-to-recover-vcsa-55-from-expired.html
So I followed the steps described in Williams article.
- Boot up vCenter Server using a current Linux live CD. I am using a Ubuntu ISO that I had.
- Mount the VMware vCenter Server Appliance root partition. This should be /dev/sda3
- Edit the /etc/shadow file with your favorite editor. Advice make a copy of the shadow file before editing it.
- When the root password is expired there should be an x in front of the password string. This was the case
- Remove the x in front of the password string and save the shadow file.
- Reboot the VCSA. If everything went well you are able to logon with the root account.
I was able to logon into the appliance again, but to prevent future problems with the password expiration I disabled the expiration in the management page of the VCSA. Because this is my home lab this is ok.
In production environments this is not advisable
Lessons learned:
- Configure a SMTP server and an alert email account so you will be notified when the password is going to be expired.
- Or in a home lab environment, disable the expiration date of the root password.
More information:
- The VMware vCenter Server Appliance release notes:https://www.vmware.com/support/vsphere5/doc/vsphere-vcenter-server-550b-release-notes.html
- VirtualGhetto blog: http://www.virtuallyghetto.com/2013/09/administrator-password-expiration-in.html
- VMware Community: https://communities.vmware.com/message/2263902
Related articles:
Di
Thursday, December 17, 2015
ofa to ovf for vmware import follies
let's dance, shall we?
it all started out with:
ResourceType instance ID 3 no support ofr hardware device type 20
from: http://www.itsecurenet.com/virtualbox-ova-to-vsphere-ovf/
it all started out with:
ResourceType instance ID 3 no support ofr hardware device type 20
from: http://www.itsecurenet.com/virtualbox-ova-to-vsphere-ovf/
How to convert VirtualBox OVA to Vsphere OVF
3. Text editor.
First of all, export your virtual machine from Virtualbox. Give the location for the file and save as ova file
After, Install the VMware OVF Tool. I am using the version 3.0.1
Once, the file has been created and the tool is installed.
Open the command line and navigate to the OVF tool folder.
Type the command below : ovftool.exe –lax <source.ova> <destination.ovf>
You can consult the guide for this tool at : http://www.vmware.com/support/developer/ovf/ovf301/ovftool-301-userguide.pdf
ovftool.exe –lax “C:\Users\ygotame\Desktop\Asterix Now.ova” “C:\Users\ygotame\Desktop\Asterix Now.ovf”
Once the command is complete, you will see three files :
1. Asterix Now.mf SHA1 Info File
2. Asterix Now.ovf Configuration file
3. Asterix Now-disk.vmdk Virtual Hard drive
Now open, Vsphere client and click to deploy ovf file.
Give the OVF file location and try to upload to the server.
You might this error : Unsupported hardware family virtualbox-2.2
Error: OVF Package is not supported by target: Line 25: Unsupported hardware family 'virtualbox-2.2'.
If it is the case for you, open the ovf file with your favorite text editor.
And, change the line :
<vssd:VirtualSystemType>virtualbox-2.2</vssd:VirtualSystemType>
with this
<vssd:VirtualSystemType>vmx-07</vssd:VirtualSystemType>
To avoid the error message : Line 66: OVF hardware element ‘ResourceType’ with instance ID ‘5’: No support for the virtual hardware device type ’20’
In the same file, modify the item Instance 5:
<Item>
<rasd:Address>0</rasd:Address>
<rasd:Caption>sataController0</rasd:Caption>
<rasd:Description>SATA Controller</rasd:Description>
<rasd:ElementName>sataController0</rasd:ElementName>
<rasd:InstanceID>5</rasd:InstanceID>
<rasd:ResourceSubType>AHCI</rasd:ResourceSubType>
<rasd:ResourceType>20</rasd:ResourceType>
</Item>
With this
<Item>
<rasd:Address>0</rasd:Address>
<rasd:Caption>SCSIController</rasd:Caption>
<rasd:Description>SCSI Controller</rasd:Description>
<rasd:ElementName>SCSIController</rasd:ElementName>
<rasd:InstanceID>5</rasd:InstanceID>
<rasd:ResourceSubType>lsilogic</rasd:ResourceSubType>
<rasd:ResourceType>6</rasd:ResourceType>
</Item>
Save the change and try again to deploy
At this time, you will get the error saying the file fail the control of integrity and could be corrupted. As the vpshere sever check the <file>.mf to verify the integrity. We will modify that to make sure the correct information is enter.
For that, download the Microsoft toll that I mention above and extract the file where you prepare. I will dump it at C:\Temp
Now, we need to find out new SHA1 key for <file>.ovf because we made some change. Therefore, open command line and navigate to the place where you had extracted the Microsoft tool.
Execute the command : fciv.exe -sha1 <filename.ovf>
fciv.exe C:\Users\ygotame\Desktop\ItSecure\OVF file new SHA1.png
Now, copy the new SHA1 key 51bd98… and open <filename>.mf
Paste the new value in the file and save it.
Once that has been done, try one more time to deploy the vm machine. This time, it should be working without any issue.
Tuesday, December 15, 2015
vnc for mac control-alt-delete
of course...
Laptop keyboard: fn+control+command+delete
Full-size keyboard: control+option+delete
Thursday, December 10, 2015
reset admin pass on win2k8 r2 when erd 6.5 doesn't work
How to Reset Your Forgotten Domain Admin Password on Server 2008 R2
Forgetting your password is always a pain, but luckily there’s an easy way to reset your Domain Administrator password. All you need is a copy of the Windows Server 2008 R2 installation disk and one simple command line trick.
Replacing Utilman.exe
Boot off the Windows disk and select the “Repair your computer” option from the lower left-hand corner.
Follow through until you get to the option to open the Command Prompt, which you’ll want to select.
First you’ll want to type in the following command to backup the utilman.exe file:
MOVE C:\Windows\System32\Utilman.exe C:\Windows\System32\Utilman.exe.bak
Now you will need to copy cmd.exe and rename it Utilman.exe:
COPY C:\Windows\System32\cmd.exe C:\Windows\System32\Utilman.exe
Now you can go ahead and reboot your machine. When its done booting up again and you are at the Logon screen click on the Ease of access icon.
I bet you weren’t expecting that open a command prompt
To change the password type:
net user administrator *
Once you press enter you will asked to set a new password and then confirm it, when entering your new password don’t worry if you can’t see them as you type, they are invisible, they are however being remembered.
Once you’re logged in again don’t forget to delete Utilman.exe and then rename Utilman.exe.bak back to plain old Utilman.exe.
from here: http://www.howtogeek.com/106333/how-to-reset-your-forgotten-domain-admin-password-on-server-2008-r2/
Thursday, December 3, 2015
no ldapsearch for me
oh come on. no ldapsearch? for serious now?
on a nice box:
# rpm -q --whatprovides /usr/bin/ldapsearch
openldap-clients
oh okay.
# yum install openldap-clients
let's try something simple...
authenticated bind:
ldapsearch -h ldap.no.where.org -p 389 -x -D "cn=admin,dc=no,dc=where,dc=org" -b "dc=no,dc=where,dc=org" -w comp\!\!plex
stupid admin and his bangs in passwords <- oh wait. that's me. heh.
unauthenticated bind
ldapsearch -h ldap.no.where.org -p 389 -x -b "dc=no,dc=where,dc=org"
oh hey, what's up with no lsof on these systems... you know who you are.
Wednesday, December 2, 2015
sles 11 enterprise to a vm hillarity
damn you old suse 10 enterprise system that i just virtualized.
1. first i get scsi ioc errors.
2. i fix that and get gdm can't start.
3. oh, and then i try to log the eff in and i get module not found or some crap.
4. and then i try to use yast and you barf.
5. and then i try to fix your ethernet card to the vmware one and no dice.
i want to call it a day, but i can't. you will not win. oh. you have reiserfs*.
r e i s e r f s. for serious?
1. After conversion, change the VMWare SCSI controller from LSI Logic Parallel to LSI Logic SAS.
2. Easy. Use your favorite LiveCD, boot up and edit /etc/inittab .
Change from 5 to 3. Servers should not have GUIs.
3. Someone installed an Oracle DB. I check /var/log/messages and see:
login: PAM [error: /lib/security/pam_limits.so: wrong ELF class: ELFCLASS32]
This is a x64 bit system. I head to /etc/pam.d/login and see this line:
session required /lib/security/pam_limits.so
No no. The PAM stack is controlled via /lib64/security . Remove that preceeding PATH.
4. The VM is on a SAN. Apparently YAST likes to do things too quickly.
# find /sys/class/scsi_generic/*/device/timeout -exec grep -H . '{}' \;
okay
# echo 180 > /sys/block/sd{a|b}/device/timeout
That's temporary.
Make it permanent:
# touch /etc/udev/rules.d/99-vmware-scsi-udev.rules
put this in the file:
ACTION=="add", SUBSYSTEMS=="scsi", ATTRS{vendor}=="VMware, " , ATTRS{model}=="VMware Virtual S", RUN+="/bin/sh -c 'echo 180 >/sys$DEVPATH/device/timeout'"
5. VMWare isn't very smart when dealing with those NICs, huh?
edit:
/etc/udev/rules.d/30-net_persistent_names.rules
VMWare commented out stuff hoping YAST would do stuff. Yast didn't. Put this in:
SUBSYSTEM=="net", ACTION=="add", SYSFS{address}=="00:50:56:98:66:5a", IMPORT="/lib/udev/rename_netiface %k eth0"
The {address} can be found on your VMWare VM properties.
# cd /etc/sysconfig/network/
# cp ifcfg-eth-id-whateveritisnow ifcfg-eth-id-00\:50\:56\:98\:66\:5a
edit ifcfg-eth-id-00\:50\:56\:98\:66\:5a
NAME='VMWare 82545EM Gigabit Ethernet Controller (Copper)'
*reiserfs murders your wife.
Subscribe to:
Posts (Atom)