User:Karl Weller
Karl Weller's Tips and Tricks
BASH Directory color
export LS_COLORS="$LS_COLORS:di=1;33"
Creality K1 Max fluidd install
#make sure latest printer firmware is installed #enable ssh root login #ssh to printer like: ssh root@192.168.0.20 (default pwd: creality_2023) cd /usr/data wget https://raw.githubusercontent.com/CrealityOfficial/K1_Series_Annex/main/fluidd/fluidd/fluidd.sh wget https://raw.githubusercontent.com/CrealityOfficial/K1_Series_Annex/main/fluidd/fluidd/fluidd.tar chmod +x fluidd.sh ./fluidd.sh install
Set/Unset disk read-only
K:\>diskpart Microsoft DiskPart version 10.0.21390.1 Copyright (C) Microsoft Corporation. On computer: WINDOWS-OGL917P DISKPART> list disk Disk ### Status Size Free Dyn Gpt -------- ------------- ------- ------- --- --- Disk 0 Online 931 GB 0 B * Disk 1 Online 465 GB 1024 KB * Disk 2 Online 4657 GB 0 B * Disk 3 Online 7452 GB 0 B * Disk 4 Online 4657 GB 0 B * Disk 5 Online 1953 GB 0 B DISKPART> select disk 5 Disk 5 is now the selected disk. DISKPART> attributes disk Current Read-only State : No Read-only : No Boot Disk : No Pagefile Disk : No Hibernation File Disk : No Crashdump Disk : No Clustered Disk : No DISKPART> attr disk set readonly Disk attributes set successfully. DISKPART> attr disk Current Read-only State : Yes Read-only : Yes Boot Disk : No Pagefile Disk : No Hibernation File Disk : No Crashdump Disk : No Clustered Disk : No DISKPART> attr disk clear readonly Disk attributes cleared successfully. DISKPART> attr disk Current Read-only State : No Read-only : No Boot Disk : No Pagefile Disk : No Hibernation File Disk : No Crashdump Disk : No Clustered Disk : No DISKPART> exit Leaving DiskPart...
OSX Java Versions
/usr/libexec/java_home -V ls -lsa /Library/Java/JavaVirtualMachines
Ubuntu view ESM Updates
sudo ua security-status --esm-apps
Sync additional and deleted files with svn
Added files:
svn status | grep "^\?" | awk '{print $2}' | xargs svn add
Deleted files:
svn st | grep ^! | awk '{print " --force "$2}' | xargs svn rm
Clear terminal screen
Add to .bash_profile
function cls { printf '\e[H\e[2J\e[3J' }
Weblogic oraInst.loc on windows
HKEY_LOCAL_MACHINE / SOFTWARE / Oracle / inst_loc = [inventory_directory]
Replace Inventory_Directory with the full path to your installer files. For example:
C:\Program Files\Oracle\Inventory
Oracle user on cdb
alter session set "_ORACLE_SCRIPT"=true; create user ODS identified by ODS;
Perl add commit to sql script
use strict; use warnings; # perl -p -i -e 's/,uid\)/,uuid\)/g' eu.sql my $file = 'ediuid.lst'; open my $info, $file or die "no file"; my $count = 0; while( my $line = <$info>) { print $line; if (++$count % 100) { } else { print "commit;\n"; } }
Cleanup Patches
dism /Online /Cleanup-Image /spsuperseded
Robocopy options
robocopy i:\ . /S /E /Z /XO /R:0
Enable Telnet Client on Windows
dism /online /Enable-Feature /FeatureName:TelnetClient
JIRA Locked
cd /etc/init.d ./jira stop rm -rf /u01/jira/jira/current/logs/attachments rm /u01/jira/jira/home/.jira-home.lock ./jira start
Purge OracleAQ
DECLARE po_t dbms_aqadm.aq$_purge_options_t; BEGIN dbms_aqadm.purge_queue_table('INQUEUEARCHIVE_TABLE', NULL, po_t); END; /
Limit Time Machine Disk Usage
as root (size in megs, example 1.5TB):
defaults write com.apple.TimeMachine MaxSize 1500000 (might really be) defaults write /Library/Preferences/com.apple.TimeMachine MaxSize 1500000
to remove quota:
defaults delete com.apple.TimeMachine MaxSize
to speed up TimeMachine:
sudo sysctl debug.lowpri_throttle_enabled=0
OSX Secure swap
sysctl vm.swapusage sudo defaults write /Library/Preferences/com.apple.virtualMemory UseEncryptedSwap -boolean no or: sudo defaults write /Library/Preferences/com.apple.virtualMemory DisableEncryptedSwap -boolean yes reboot
Make juniper work on mac after upgrade to Yosemite
sudo nvram boot-args="kext-dev-mode=1"
WebLogic Find forgotten passwords
pp.py
from weblogic.security.internal import * from weblogic.security.internal.encryption import * encryptionService = SerializedSystemIni.getEncryptionService(".") clearOrEncryptService = ClearOrEncryptedService(encryptionService) passwd = raw_input("Enter encrypted password of one which you wanted to decrypt : ") plainpwd = passwd.replace("\\", "") print "Plain Text password is: " + clearOrEncryptService.decrypt(plainpwd)
pp.bat
echo "run setDomaimnEnv first" echo "include {AES} in the password string" java weblogic.WLST pp.py
UBUNTU Remount for dd
sudo su - init 1 service rsyslog stop check for open files with: lsof / | awk '$4 ~ /[0-9].*w/' mount -o remount,ro /dev/sda1 / (you might need a -t type, just run mount to see what it's currently mounted as). now dd like: dd if=/dev/sda1 of=/media/My\ Passport/sda1.dd bs=10M
Weblogic Filtering
Login into the console. Click on the Domain Name –> Security –> Filter You can use the default class : weblogic.security.net.ConnectionFilterImpl target localAddress localPort action protocolList Here are the definitions for the parameters of a connection filter rule: target - specifies the client hosts that the rule must examine. We discuss its syntax later. localAddress - refers to the server’s host address to which the client connects. If you specify an asterisk (*), this matches all local IP addresses. localPort - indicates the server port to which the client connects. If you specify an asterisk (*), this matches all available ports. action - indicates whether the rule should allow or reject the incoming connection request. It can take two possible values: allow or deny. protocolList - define a space-separated list of protocol names that should be matched. The protocol names can be: http, https, t3, t3s etc. If no protocols are listed, the rule checks for all protocols. For Example: www.abc.com 127.0.0.1 7001 deny t3 t3s http https If you want to deny t3 t3s http https protocol access from www.abc.com to the local server.
windows tcp
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\TCPIP\Parameters\TcpTimedWaitDelay 30 (DWORD) decimal HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\AFD\Parameters\EnableDynamicBacklog 1 (DWORD) HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\AFD\Parameters\MinimumDynamicBacklog 20 (DWORD) decimal HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\AFD\Parameters\MaximumDynamicBacklog 1000 (DWORD) decimal HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\AFD\Parameters\DynamicBacklogGrowthDelta 10 (DWORD) decimal HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\AFD\Parameters\KeepAliveInterval 1 (DWORD) HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\Interfaces\{Interface GUID}\TcpNoDelay 1 (DWORD) HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\Interfaces\{Interface GUID}\TcpAckFrequency 1 (DWORD) netsh int tcp set global autotuninglevel=disabled netsh int ipv4 set dynamicportrange tcp start=32767 num=32768
speed up ssh server logins
in /etc/ssh/sshd_config
GSSAPIAuthentication no UseDNS no
Reset Surface 3 Pro
Step 1: Press and hold the power button on your Surface for 30 seconds. Step 2: Press and hold the volume-up button and the power button on your Surface at the same time for at least 15 seconds, and then release both. The screen may flash the Surface logo, but continue holding the buttons down for at least 15 seconds. Step 3: After you release the buttons, wait 10 seconds. Step 4: Press and release the power button on your Surface to turn it back on.
find
My favorite find:
find . -name "*" -exec grep -i "search term" {} /dev/null \;
You can also exec a rm to get rid of files when a directory has too many entries and "rm *" no longer works.
clone a machine (physical-to-virtual)
Boot using your favorite linux livecd:
# mount a usb drive (example /mnt/usb) # dd sda to file dd if=/dev/sda of=/mnt/usb/sda.dd conv=sync,noerror bs=8192k # move file to VirtualBox host VBoxManage convertdd sda.dd sda.vdi --format VDI # now create a num VM using existing hard drive sda.vdi ...
You can also exec a rm to get rid of files when a directory has too many entries and "rm *" no longer works.
unlock account
as root:
passwd oracle newpassword newpassword passwd -u -f oracle faillog -u oracle -r
shrink vm
set path=%PATH%;"C:\Program Files\VMware\VMware Server" vmware-vdiskmanager -r sourceDisk.vmdk -t 0 targetDisk.vmdk vmware-vdiskmanager.exe -d vmdkpath vmware-mount.exe driveletter vmdkpath vmware-vdiskmanager.exe -p driveletter vmware-mount.exe driveletter /d vmware-vdiskmanager.exe -k vmdkpath
sample smtp session
telnet some-host 25
HELO MAIL FROM: <WELLERK@saic.com> RCPT TO: <WELLERK@saic.com> DATA Message Text Line1 This is the email message text Message Text Line2 Message Text Line3 Hope this helps, Bruce begin 666 email_attachment.lst M4F5P;W)T($QI;F4Q(%1H:7,@:7,@=&AE($%T=&%C:&5D(%)E<&]R=`I297!O 6<G0@3&EN93(*4F5P;W)T($QI;F4S"FAE ` end . QUIT
get a cert
#!/bin/sh # # usage: retrieve-cert.sh remote.host.name [port] # REMHOST=$1 REMPORT=${2:-443} echo |\ openssl s_client -connect ${REMHOST}:${REMPORT} 2>&1 |\ sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p'
keytool self signed certs
keytool -genkey -keyalg RSA -alias selfsigned -keystore keystore.jks -storepass password -validity 10000 -keysize 2048 enter servername for First,Lastname
self signed certs
D:\RedHat\EWS\etc\ssl>..\..\bin\openssl genrsa -des3 -out server.key 4096 D:\RedHat\EWS\etc\ssl>..\..\bin\openssl req -new -config openssl.cnf -key server.key -out server.csr Enter pass phrase for server.key: You are about to be asked to enter information that will be incorporated into your certificate request. What you are about to enter is what is called a Distinguished Name or a DN. There are quite a few fields but you can leave some blank For some fields there will be a default value, If you enter '.', the field will be left blank. ----- Country Name (2 letter code) [GB]:US State or Province Name (full name) [Berkshire]:Virginia Locality Name (eg, city) [Newbury]:Falls Church Organization Name (eg, company) [My Company Ltd]:SAIC Organizational Unit Name (eg, section) []:hcts Common Name (eg, your name or your server's hostname) []:dodesbdev.b224.saic.com Email Address []:administrator@dodesbdev.b224.saic.com Please enter the following 'extra' attributes to be sent with your certificate request A challenge password []:xxx An optional company name []: D:\RedHat\EWS\etc\ssl> D:\RedHat\EWS\etc\ssl>..\..\bin\openssl x509 -req -days 3650 -in server.csr -sig nkey server.key -out server.crt Loading 'screen' into random state - done Signature ok subject=/C=US/ST=Virginia/L=Falls Church/O=SAIC/OU=hcts/CN=dodesbdev.b224.saic.c om/emailAddress=administrator@dodesbdev.b224.saic.com Getting Private key Enter pass phrase for server.key: D:\RedHat\EWS\etc\ssl> D:\RedHat\EWS\etc\ssl>openssl rsa -in server.key -out server.key.insecure 'openssl' is not recognized as an internal or external command, operable program or batch file. D:\RedHat\EWS\etc\ssl>..\..\bin\openssl rsa -in server.key -out server.key.insec ure Enter pass phrase for server.key: writing RSA key D:\RedHat\EWS\etc\ssl>ren server.key server.key.secure D:\RedHat\EWS\etc\ssl>copy server.key.insecure server.key 1 file(s) copied. D:\RedHat\EWS\etc\ssl> --------------------- WEBLOGIC ------------------------------ openssl genrsa -des3 -out server.key 4096 DemoIdentityPassPhrase DemoIdentityPassPhrase openssl req -new -config openssl.cnf -key server.key -out server.csr Enter pass phrase for server.key: DemoIdentityPassPhrase You are about to be asked to enter information that will be incorporated into your certificate request. What you are about to enter is what is called a Distinguished Name or a DN. There are quite a few fields but you can leave some blank For some fields there will be a default value, If you enter '.', the field will be left blank. ----- Country Name (2 letter code) [GB]:US State or Province Name (full name) [Berkshire]:Virginia Locality Name (eg, city) [Newbury]:Falls Church Organization Name (eg, company) [My Company Ltd]:SAIC Organizational Unit Name (eg, section) []:hcts Common Name (eg, your name or your server's hostname) []:dev1wavm1d.Sky5Net.local Email Address []:administrator@dev1wavm1d.Sky5Net.local Please enter the following 'extra' attributes to be sent with your certificate request A challenge password []: An optional company name []: openssl x509 -req -days 3650 -in server.csr -signkey server.key -out server.crt DemoIdentityPassPhrase ##openssl pkcs8 -topk8 -nocrypt -in server.key -out server.key.der -outform der ##Enter pass phrase for server.key: DemoIdentityPassPhrase openssl rsa -in server.key -out server.key.insec openssl pkcs8 -topk8 -nocrypt -in server.key.insec -out server.key.der -outform der java ImportKey server.key.der server.crt DemoIdentity ren demoidentity.jks d.jks keytool -importkeystore -srckeystore d.jks -srcstorepass DemoIdentityKeyStorePassPhrase -srcalias DemoIdentity -srckeypass DemoIdentityKeyStorePassPhrase -destkeystore d2.jks -deststorepass DemoIdentityKeyStorePassPhrase -destalias DemoIdentity -destkeypass DemoIdentityPassPhrase copy d2.jks demoidentity.jks WEBLOGIC $> cd $MIDDLEWARE_HOME/wlserver_10.3/server/lib/ Set the right environment: view sourceprint?$> . ../bin/setWLSEnv.sh Create a new certificate for your machine (test01.local.lan): view sourceprint?$> java utils.CertGen -cn test01.local.lan -keyfilepass DemoIdentityPassPhrase -certfile testcert -keyfile testkey -strength 2048 -digestalgorithm SHA256 Generating a certificate with common name test01.local.lan and key strength 1024 issued by CA with certificate from CertGenCA.der file and key from CertGenCAKey.der file Import this certifcate in a new key store: view sourceprint?$> java utils.ImportPrivateKey newkeystore.jks DemoIdentityKeyStorePassPhrase demoidentity DemoIdentityPassPhrase testcert.pem testkey.pem Imported private key testkey.pem and certificate testcert.pem into a new keystore newkeystore.jks of type jks under alias demoidentity Now check if your public key/certifcate is imported in the new key store. view sourceprint?$> keytool -v -list -keystore newkeystore.jks -storepass DemoIdentityKeyStorePassPhrase Keystore type: JKS Keystore provider: SUN Your keystore contains 1 entry Alias name: demoidentity Creation date: Apr 12, 2010 Entry type: PrivateKeyEntry Certificate chain length: 1 Certificate[1]: Owner: CN=test01.local.lan, OU=FOR TESTING ONLY, O=MyOrganization, L=MyTown, ST=MyState, C=US Issuer: CN=CertGenCAB, OU=FOR TESTING ONLY, O=MyOrganization, L=MyTown, ST=MyState, C=US Serial number: 4acc7d27882f10e38823617098da6d91 Valid from: Sun Apr 11 15:56:23 CEST 2010 until: Sat Apr 12 15:56:23 CEST 2025 Certificate fingerprints: MD5: 12:97:52:76:3A:AB:1D:36:D7:DD:71:BB:8E:17:96:74 SHA1: 49:0A:09:CC:6C:9E:F0:6E:90:8F:64:C7:D3:BF:2D:39:E6:EB:BC:DD Signature algorithm name: MD5withRSA Version: 1 Replace the old DemoIdentity.jks This newkeystore.jks is your new DemoIdentity.jks view sourceprint?$> ls *.jks DemoIdentity.jks DemoTrust.jks newkeystore.jks $> mv DemoIdentity.jks DemoIdentity.jks_ $> cp newkeystore.jks DemoIdentity.jks
analyze sql talbes
SET LONG 2000000 SET PAGESIZE 0 set echo on newpage 0 space 0 pagesize 0 feed off head off trimspool on set linesize 2000 SET SQLPROMPT '-- SQL> ' spool statsscript.sql select 'alter index '||owner||'.'||index_name||' compute statistics;' from dba_indexes; select 'EXEC DBMS_STATS.gather_table_stats('''||owner||''', '''||table_name||''');' from dba_tables; select 'EXEC DBMS_STATS.gather_index_stats('''||owner||''', '''||index_name||''');' from dba_indexes; spool off @@statsscript.sql quit;
prompt
PS1='\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;35m\]\w\[\033[00m\]\$ ' export PS1
ssh keys
VMS mu sshkeygen/ssh2 Convert OpenSSH key to SSH2 key #ssh-keygen -e -f ~/.ssh/id_dsa.pub > ~/.ssh/id_dsa_ssh2.pub Convert SSH2 key to OpenSSH key #ssh-keygen -i -f ~/.ssh/id_dsa_1024_a.pub > ~/.ssh/id_dsa_1024_a_openssh.pub OpenSSH To generate an OpenSSH sshv2 key $ ssh-keygen -t dsa -f newkey To export to ssh.com $ ssh-keygen -e -f newkey.pub SSH To generate a key: $ ssh-keygen To convert from ssh.com to OpenSSH (using OpenSSH ssh-keygen): $ ssh-keygen -i -f id_dsa_2048_b.pub OpenSSH v2 -> SSH v2 On the OpenSSH box, create a DSA key via the following: $ ssh-keygen -t dsa Export the key into ssh.com v2 format: $ ssh-keygen -e -f ~/.ssh/id_dsa.pub > newPubKey Copy the converted ssh key to the ssh.com server $ scp newPubKey server:.ssh2/id_dsa.pub On the server, tell the ssh.com server that the public key is allowed: $ echo “Key id_dsa.pub” >> ~/.ssh2/authorization SSH v2 -> OpenSSH v2 On the ssh.com box, generate a DSA key: $ ssh-keygen Copy the generated key to the openssh box: $ scp ~/.ssh2/id_dsa_1024_a.pub server:.ssh Convert the public key to openssh format and append to authorized_keys: $ ssh-keygen -i -f id_dsa_1024_a.pub >> ~/.ssh/authorized_keys On the ssh.com box setup the private key: $ echo “IdKey id_dsa_1024_a” >> ~/.ssh2/identification SSH v2 -> SSH v2 On the ssh.com client, generate a DSA key: $ ssh-keygen Copy the generated key to the server: $ scp ~/.ssh2/id_dsa_1024_a.pub server:.ssh2 On the server, tell the ssh.com server that the public key is allowed: $ echo “Key id_dsa._1024_a.pub” >> ~/.ssh2/authorization On the ssh.com client setup the private key: $ echo “IdKey id_dsa_1024_a” >> ~/.ssh2/identification OpenSSH v2 -> OpenSSH v2 On the OpenSSH box, create a DSA key via the following: $ ssh-keygen -t dsa Copy the ssh key to the server $ scp ~/.ssh/id_dsa.pub server:.ssh/id_dsa.pub Add the key to the authorized_keys file on the server $ cat ~/.ssh/id_dsa.pub >> ~/.ssh/authorized_keys
oracle Solaris project
# projadd -U oracle -K "project.max-shm-memory=(priv,4g,deny)" user.oracle # projmod -sK "process.max-sem-nsems=(priv,256,deny)" user.oracle # projmod -sK "project.max-sem-ids=(priv,100,deny)" user.oracle # projmod -sK "project.max-shm-ids=(priv,100,deny)" user.oracle
notice the second line is process, oracle documents it as project in many documents
Quicky VBS
Dim fso, stdin, stdout, stderr Set fso = CreateObject ("Scripting.FileSystemObject") set stdout = fso.GetStandardStream (1) for i = 1 to 255 stdout.writeline "ping -n 1 -w 800 192.168.1."+Cstr(i) next
run as: cscript p.vbs | find "ping" > t.bat
colorize grep
if echo hello|grep --color=auto l >/dev/null 2>&1; then export GREP_OPTIONS='--color=auto' GREP_COLOR='1;33;44'; fi
disable smartd
For redhat on a vm:
chkconfig smartd off
service smartd stop
oid tuning
db: session_cached_cursors 100 cursor_space_for_time true processes 500 (or greater) oid: orclmaxcc 20 orclserverprocs 4 (or number of cpus) orclskiprefinsql 1 orclldapconntimeout 900
sqlplus raw output
set echo on newpage 0 space 0 pagesize 0 feed off head off trimspool on set linesize 2000
convert file to upper case
--- snip upper.pl --- line: while (<>) { tr/[a-z]/[A-Z]/; print $_; next line } --- end snip --- perl upper.pl < input.txt > output.txt
Global replace - good for any size or number of files
perl -pi -e 's/old_string/new_string/g' file_pattern
Shrink SQL Server Log File
ALWAYS Perform a full database backup !!!
use database
go
sp_helpdb database
go
BACKUP LOG database WITH TRUNCATE_ONLY
go
DBCC SHRINKFILE(database_log,100)
go
awk retrieve a column
awk '{ split($0,a,","); print a[2]; }' t.lst
cleanup ldifwrite
sed -n 'H; ${ x; s/\n//; s/\n //g; p;}' dumped.ldif > dumped2.ldif egrep -v "orclguid|creatorsname|modifiersname|createtimestamp|modifytimestamp|pwdchangedtime|authpassword|orclnormdn" dumped2.ldif > new.ldif
Solaris install
boot net -v - install ------------------------ /etc/default/passwd: MINNONALPHA=0 groupadd -g 1000 dba useradd -g 1000 -u 1000 -d /export/home/oracle oracle mkdir /export/home mkdir /export/home/oracle chmod 775 /export chmod 775 /export/home chown oracle:dba /export/home/oracle passwd oracle bash-3.2$ cat .profile PATH=/usr/X11/bin:/usr/bin:/usr/openwin/bin:/usr/dt/bin:/usr/local/bin:/usr/local/ssl/bin:/opt/sfw/bin:$PATH export PATH vncserver vncserver -kill :1 bash-3.2$ cat /export/home/oracle/.vnc/xstartup #!/bin/sh [ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources xsetroot -solid grey vncconfig -iconic & xterm -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" & gnome-session & #twm & vncserver --------------- apply 10_Recommended ./installpatchset --s10patchset ------------------------ add packages: coreutils-8.11-sol10-sparc-local lsof-4.74-sol10-sparc-local curl-7.15.4-sol10-sparc-local ncurses-5.4-sol10-sparc-local gcc-3.4.6-sol10-sparc-local openssl-0.9.8b-sol10-sparc-local glib-1.2.10-sol10-sparc-local glib-2.6.2-sol10-sparc-local screen-4.0.2-sol9-sparc-local gmp-4.2.1-sol10-sparc-local top-3.6-sol10-sparc-local gtk+-1.2.10-sol10-sparc-local vim-6.3-sol10-sparc-local jpeg-8a-sol10-sparc-local wget-1.10.2-sol10-sparc-local libgcc-3.4.6-sol10-sparc-local libiconv-1.14-sol10-sparc-local xrender-0.8.3-sol10-sparc-local libintl-3.4.0-sol10-sparc-local zlib-1.2.5-sol10-sparc-local ---------------------------------- Fix banners: /etc/ssh/issue /etc/default/telnetd ---------------------------------- bash-3.00# cat /etc/inet/ntp.conf server 149.8.61.148 prefer driftfile /etc/ntp.drift bash-3.00# cat /etc/ntp.drift 0.0 svcadm enable svc:/network/ntp --------- modify /etc/hosts put long machine.b224.saic.com name first 192.168.1.121 tolblade1 192.168.1.122 tolblade2 192.168.1.123 tolblade3 192.168.1.124 tolblade4 192.168.1.125 tolblade5 192.168.1.126 tolblade6 192.168.1.127 tolblade7 192.168.1.128 tolblade8 192.168.1.129 tolblade9 192.168.1.130 tolblade10 ----------- create /etc/defaultdomain b224.saic.com --------------------------------- reboot
zfs info
# mkfile 100m disk1 disk2 disk3 disk5 # mkfile 50m disk4 # ls -l disk* -rw------T 1 root root 104857600 Sep 11 12:15 disk1 -rw------T 1 root root 104857600 Sep 11 12:15 disk2 -rw------T 1 root root 104857600 Sep 11 12:15 disk3 -rw------T 1 root root 52428800 Sep 11 12:15 disk4 -rw------T 1 root root 104857600 Sep 11 12:15 disk5 Create some “virtual devices” or vdevs as described in the zpool documentation. These can also be real disk slices if you have them available. # zpool create myzfs /disk1 /disk2 # zpool list NAME SIZE USED AVAIL CAP HEALTH ALTROOT myzfs 191M 94K 191M 0% ONLINE - Create a storage pool and check the size and usage. # zpool status -v pool: myzfs state: ONLINE scrub: none requested config: NAME STATE READ WRITE CKSUM myzfs ONLINE 0 0 0 /disk1 ONLINE 0 0 0 /disk2 ONLINE 0 0 0 errors: No known data errors Get more detailed status of the zfs storage pool. # zpool destroy myzfs # zpool list no pools available Destroy a zfs storage pool # zpool create myzfs mirror /disk1 /disk4 invalid vdev specification use '-f' to override the following errors: mirror contains devices of different sizes Attempt to create a zfs pool with different size vdevs fails. Using -f options forces it to occur but only uses space allowed by smallest device. # zpool create myzfs mirror /disk1 /disk2 /disk3 # zpool list NAME SIZE USED AVAIL CAP HEALTH ALTROOT myzfs 95.5M 112K 95.4M 0% ONLINE - # zpool status -v pool: myzfs state: ONLINE scrub: none requested config: NAME STATE READ WRITE CKSUM myzfs ONLINE 0 0 0 mirror ONLINE 0 0 0 /disk1 ONLINE 0 0 0 /disk2 ONLINE 0 0 0 /disk3 ONLINE 0 0 0 errors: No known data errors Create a mirrored storage pool. In this case, a 3 way mirrored storage pool. # zpool detach myzfs /disk3 # zpool status -v pool: myzfs state: ONLINE scrub: none requested config: NAME STATE READ WRITE CKSUM myzfs ONLINE 0 0 0 mirror ONLINE 0 0 0 /disk1 ONLINE 0 0 0 /disk2 ONLINE 0 0 0 errors: No known data errors Detach a device from a mirrored pool. # zpool attach myzfs /disk1 /disk3 # zpool status -v pool: myzfs state: ONLINE scrub: resilver completed with 0 errors on Tue Sep 11 13:31:49 2007 config: NAME STATE READ WRITE CKSUM myzfs ONLINE 0 0 0 mirror ONLINE 0 0 0 /disk1 ONLINE 0 0 0 /disk2 ONLINE 0 0 0 /disk3 ONLINE 0 0 0 errors: No known data errors Attach device to pool. This creates a two-way mirror is the pool is not already a mirror, else it adds another mirror, in this case making it a 3 way mirror. # zpool remove myzfs /disk3 cannot remove /disk3: only inactive hot spares can be removed # zpool detach myzfs /disk3 Attempt to remove a device from a pool. In this case it’s a mirror, so we must use “zpool detach”. # zpool add myzfs spare /disk3 # zpool status -v pool: myzfs state: ONLINE scrub: none requested config: NAME STATE READ WRITE CKSUM myzfs ONLINE 0 0 0 mirror ONLINE 0 0 0 /disk1 ONLINE 0 0 0 /disk2 ONLINE 0 0 0 spares /disk3 AVAIL errors: No known data errors Add a hot spare to a storage pool. # zpool remove myzfs /disk3 # zpool status -v pool: myzfs state: ONLINE scrub: none requested config: NAME STATE READ WRITE CKSUM myzfs ONLINE 0 0 0 mirror ONLINE 0 0 0 /disk1 ONLINE 0 0 0 /disk2 ONLINE 0 0 0 errors: No known data errors Remove a hot spare from a pool. # zpool offline myzfs /disk1 # zpool status -v pool: myzfs state: DEGRADED status: One or more devices has been taken offline by the administrator. Sufficient replicas exist for the pool to continue functioning in a degraded state. action: Online the device using 'zpool online' or replace the device with 'zpool replace'. scrub: resilver completed with 0 errors on Tue Sep 11 13:39:25 2007 config: NAME STATE READ WRITE CKSUM myzfs DEGRADED 0 0 0 mirror DEGRADED 0 0 0 /disk1 OFFLINE 0 0 0 /disk2 ONLINE 0 0 0 errors: No known data errors Take the specified device offline. No attempt to read or write to the device will take place until it’s brought back online. Use the -t option to temporarily offline a device. A reboot will bring the device back online. # zpool online myzfs /disk1 # zpool status -v pool: myzfs state: ONLINE scrub: resilver completed with 0 errors on Tue Sep 11 13:47:14 2007 config: NAME STATE READ WRITE CKSUM myzfs ONLINE 0 0 0 mirror ONLINE 0 0 0 /disk1 ONLINE 0 0 0 /disk2 ONLINE 0 0 0 errors: No known data errors Bring the specified device online. # zpool replace myzfs /disk1 /disk3 # zpool status -v pool: myzfs state: ONLINE scrub: resilver completed with 0 errors on Tue Sep 11 13:25:48 2007 config: NAME STATE READ WRITE CKSUM myzfs ONLINE 0 0 0 mirror ONLINE 0 0 0 /disk3 ONLINE 0 0 0 /disk2 ONLINE 0 0 0 errors: No known data errors Replace a disk in a pool with another disk, for example when a disk fails # zpool scrub myzfs Perform a scrub of the storage pool to verify that it checksums correctly. On mirror or raidz pools, ZFS will automatically repair any damage. WARNING: scrubbing is I/O intensive. # zpool export myzfs # zpool list no pools available Export a pool from the system for importing on another system. # zpool import -d / myzfs # zpool list NAME SIZE USED AVAIL CAP HEALTH ALTROOT myzfs 95.5M 114K 95.4M 0% ONLINE - Import a previously exported storage pool. If -d is not specified, this command searches /dev/dsk. As we’re using files in this example, we need to specify the directory of the files used by the storage pool. # zpool upgrade This system is currently running ZFS pool version 8. All pools are formatted using this version. # zpool upgrade -v This system is currently running ZFS pool version 8. The following versions are supported: VER DESCRIPTION --- -------------------------------------------------------- 1 Initial ZFS version 2 Ditto blocks (replicated metadata) 3 Hot spares and double parity RAID-Z 4 zpool history 5 Compression using the gzip algorithm 6 pool properties 7 Separate intent log devices 8 Delegated administration For more information on a particular version, including supported releases, see: http://www.opensolaris.org/os/community/zfs/version/N Where 'N' is the version number. Display pools format version. The -v flag shows the features supported by the current version. Use the -a flag to upgrade all pools to the latest on-disk version. Pools that are upgraded will no longer be accessible to any systems running older versions. # zpool iostat 5 capacity operations bandwidth pool used avail read write read write ---------- ----- ----- ----- ----- ----- ----- myzfs 112K 95.4M 0 4 26 11.4K myzfs 112K 95.4M 0 0 0 0 myzfs 112K 95.4M 0 0 0 0 Get I/O statistics for the pool # zfs create myzfs/colin # df -h Filesystem kbytes used avail capacity Mounted on ... myzfs/colin 64M 18K 63M 1% /myzfs/colin Create a file system and check it with standard df -h command. File systems are automatically mounted by default under the /zfs location. See the Mountpoints section of the zfs man page for more details. # zfs list NAME USED AVAIL REFER MOUNTPOINT myzfs 139K 63.4M 19K /myzfs myzfs/colin 18K 63.4M 18K /myzfs/colin List current zfs file systems. # zpool add myzfs /disk1 invalid vdev specification use '-f' to override the following errors: mismatched replication level: pool uses mirror and new vdev is file Attempt to add a single vdev to a mirrored set fails # zpool add myzfs mirror /disk1 /disk5 # zpool status -v pool: myzfs state: ONLINE scrub: none requested config: NAME STATE READ WRITE CKSUM myzfs ONLINE 0 0 0 mirror ONLINE 0 0 0 //disk3 ONLINE 0 0 0 //disk2 ONLINE 0 0 0 mirror ONLINE 0 0 0 /disk1 ONLINE 0 0 0 /disk5 ONLINE 0 0 0 errors: No known data errors Add a mirrored set of vdevs # zfs create myzfs/colin2 # zfs list NAME USED AVAIL REFER MOUNTPOINT myzfs 172K 159M 21K /myzfs myzfs/colin 18K 159M 18K /myzfs/colin myzfs/colin2 18K 159M 18K /myzfs/colin2 Create a second file system. Note that both file system show 159M available because no quotas are set. Each “could” grow to fill the pool. # zfs set reservation=20m myzfs/colin # zfs list -o reservation RESERV none 20M none Reserve a specified amount of space for a file system ensuring that other users don’t take up all the space. # zfs set quota=20m myzfs/colin2 # zfs list -o quota myzfs/colin myzfs/colin2 QUOTA none 20M Set and view quotas # zfs set compression=on myzfs/colin2 # zfs list -o compression COMPRESS off off on Turn on and verify compression # zfs snapshot myzfs/colin@test # zfs list NAME USED AVAIL REFER MOUNTPOINT myzfs 20.2M 139M 21K /myzfs myzfs/colin 18K 159M 18K /myzfs/colin myzfs/colin@test 0 - 18K - myzfs/colin2 18K 20.0M 18K /myzfs/colin2 Create a snapshot called test. # zfs rollback myzfs/colin@test Rollback to a snapshot. # zfs clone myzfs/colin@test myzfs/colin3 # zfs list NAME USED AVAIL REFER MOUNTPOINT myzfs 20.2M 139M 21K /myzfs myzfs/colin 18K 159M 18K /myzfs/colin myzfs/colin@test 0 - 18K - myzfs/colin2 18K 20.0M 18K /myzfs/colin2 myzfs/colin3 0 139M 18K /myzfs/colin3 A snapshot is not directly addressable. A clone must be made. The target dataset can be located anywhere in the ZFS hierarchy, and will be created as the same type as the original. # zfs destroy myzfs/colin2 # zfs list NAME USED AVAIL REFER MOUNTPOINT myzfs 20.1M 139M 22K /myzfs myzfs/colin 18K 159M 18K /myzfs/colin myzfs/colin@test 0 - 18K - myzfs/colin3 0 139M 18K /myzfs/colin3 Destroy a filesystem # zfs destroy myzfs/colin cannot destroy 'myzfs/colin': filesystem has children use '-r' to destroy the following datasets: myzfs/colin@test Attempt to destroy a filesystem that had a child. In this case, the snapshot filesystem. We must either remove the snapshot, or make a clone and promote the clone. # zfs promote myzfs/colin3 # zfs list NAME USED AVAIL REFER MOUNTPOINT myzfs 20.1M 139M 21K /myzfs myzfs/colin 0 159M 18K /myzfs/colin myzfs/colin3 18K 139M 18K /myzfs/colin3 myzfs/colin3@test 0 - 18K - # zfs destroy myzfs/colin # zfs list NAME USED AVAIL REFER MOUNTPOINT myzfs 147K 159M 21K /myzfs myzfs/colin3 18K 159M 18K /myzfs/colin3 myzfs/colin3@test 0 - 18K - Promte a clone filesystem to no longer be a dependent on it’s “origin” snapshot. This now associates makes the snapshot a child of the cloned filesystem. We can then delete the original filesystem. # zfs rename myzfs/colin3 myzfs/bob # zfs list NAME USED AVAIL REFER MOUNTPOINT myzfs 153K 159M 21K /myzfs myzfs/bob 18K 159M 18K /myzfs/bob myzfs/bob@test 0 - 18K - # zfs rename myzfs/bob@test myzfs/bob@newtest # zfs list NAME USED AVAIL REFER MOUNTPOINT myzfs 146K 159M 20K /myzfs myzfs/bob 18K 159M 18K /myzfs/bob myzfs/bob@newtest 0 - 18K - Rename a filesystem, and separately rename the snapshot. # zfs get all NAME PROPERTY VALUE SOURCE myzfs type filesystem - myzfs creation Tue Sep 11 14:21 2007 - myzfs used 146K - myzfs available 159M - myzfs referenced 20K - [...] Display properties for the given datasets. This can be refined further using options. # zpool destroy myzfs cannot destroy 'myzfs': pool is not empty use '-f' to force destruction anyway Can’t destroy a pool with active filesystems. # zfs unmount myzfs/bob # df -h myzfs 159M 20K 159M 1% /myzfs Unmount a ZFS file system # zfs mount myzfs/bob # df -h myzfs 159M 20K 159M 1% /myzfs myzfs/bob 159M 18K 159M 1% /myzfs/bob Mount a ZFS filesystem. This is usually automatically done on boot. # zfs send myzfs/bob@newtest | ssh localhost zfs receive myzfs/backup # zfs list NAME USED AVAIL REFER MOUNTPOINT myzfs 172K 159M 20K /myzfs myzfs/backup 18K 159M 18K /myzfs/backup myzfs/backup@newtest 0 - 18K - myzfs/bob 18K 159M 18K /myzfs/bob myzfs/bob@newtest 0 - 18K - Create a stream representation of the snapshot and redirect it to zfs receive. In this example I’ve redirected to the localhost for illustration purposes. This can be used to backup to a remote host, or even to a local file. # zpool history History for 'myzfs': 2007-09-11.15:35:50 zpool create myzfs mirror /disk1 /disk2 /disk3 2007-09-11.15:36:00 zpool detach myzfs /disk3 2007-09-11.15:36:10 zpool attach myzfs /disk1 /disk3 2007-09-11.15:36:53 zpool detach myzfs /disk3 2007-09-11.15:36:59 zpool add myzfs spare /disk3 2007-09-11.15:37:09 zpool remove myzfs /disk3 2007-09-11.15:37:18 zpool offline myzfs /disk1 2007-09-11.15:37:27 zpool online myzfs /disk1 2007-09-11.15:37:37 zpool replace myzfs /disk1 /disk3 2007-09-11.15:37:47 zpool scrub myzfs 2007-09-11.15:37:57 zpool export myzfs 2007-09-11.15:38:05 zpool import -d / myzfs 2007-09-11.15:38:52 zfs create myzfs/colin 2007-09-11.15:39:27 zpool add myzfs mirror /disk1 /disk5 2007-09-11.15:39:38 zfs create myzfs/colin2 2007-09-11.15:39:50 zfs set reservation=20m myzfs/colin 2007-09-11.15:40:18 zfs set quota=20m myzfs/colin2 2007-09-11.15:40:35 zfs set compression=on myzfs/colin2 2007-09-11.15:40:48 zfs snapshot myzfs/colin@test 2007-09-11.15:40:59 zfs rollback myzfs/colin@test 2007-09-11.15:41:11 zfs clone myzfs/colin@test myzfs/colin3 2007-09-11.15:41:25 zfs destroy myzfs/colin2 2007-09-11.15:42:12 zfs promote myzfs/colin3 2007-09-11.15:42:26 zfs rename myzfs/colin3 myzfs/bob 2007-09-11.15:42:57 zfs destroy myzfs/colin 2007-09-11.15:43:23 zfs rename myzfs/bob@test myzfs/bob@newtest 2007-09-11.15:44:30 zfs receive myzfs/backup # zpool destroy -f myzfs # zpool status -v no pools available Use the -f option to destroy a pool with files systems created
Solaris logical domains ldm
copy ldom.tar /root cd /root tar -xvf ldom.tar cd ldom/Install ./install-ldm say no to launch? mkdir /ldoms mkdir /ldoms/disks cd /ldoms/disks/ mkfile 16g tb9a.dsk mkfile 16g tb9b.dsk mkfile 16g tb9c.dsk mkfile 16g tb9d.dsk ldm add-vds primary-vds0 primary ldm add-vcc port-range=5000-5100 primary-vcc0 primary ldm add-vsw net-dev=e1000g1 primary-vsw0 primary ldm set-mau 0 primary -- reconnect if it kicks you ldm set-vcpu 16 primary ldm set-memory 16000M primary ldm add-spconfig initial ifconfig vsw0 plumb --log into console as root ifconfig e1000g1 down unplumb ifconfig vsw0 192.168.1.129 netmask 255.255.255.0 broadcast + up mv /etc/hostname.e1000g1 /etc/hostname.vsw0 svcadm enable vntsd ldm add-spconfig initial2 --log out of console - ssh back into host ldm add-vdiskserverdevice /ldoms/disks/tb9a.dsk fdisk0@primary-vds0 ldm add-vdiskserverdevice /ldoms/disks/tb9b.dsk fdisk1@primary-vds0 ldm add-vdiskserverdevice /ldoms/disks/tb9c.dsk fdisk2@primary-vds0 ldm add-vdiskserverdevice /ldoms/disks/tb9d.dsk fdisk3@primary-vds0 -- -- add & install a VM -- ldm add-domain tb9a ldm add-vcpu 4 tb9a ldm add-memory 4G tb9a ldm add-vnet vnet1 primary-vsw0 tb9a ldm add-vdisk vdisk1 fdisk0@primary-vds0 tb9a ldm bind tb9a ldm set-var auto-boot\?=false tb9a ldm start-domain tb9a ldm ls telnet localhost 5000 boot net -v - install -- on tolblade2: add tb9a to /etc/hosts -- on tolblade2: cd /u01/export/Solaris_10/Tools ; ./add_install_client -e 0:14:4f:f8:be:96 tb9a sun4v -- on tolblade2 check: /etc/hosts /etc/bootparams /etc/ethers -- installer on tb9a should pop up 0 - for english 6 - pc console press ESC 2 press ESC 2 specify a route 192.168.1.1 ESC 2 ESC 2 ESC 2 ESC 2 Name services - select DNS ESC 2 Domain name: b224.saic.com ESC 2 name servers: 149.8.61.156 .165 149.8.48.220 ESC 2 Search domains: b224.saic.com saic.com ESC 2 ESC 2 NO ESC 2 ESC 2 ESC 2 Americas ESC 2 United States ESC 2 Eastern Time ESC 2 ESC 2 ESC 2 Unselect register ESC 2 ESC 2 Hit enter ESC 2 ESC 2 ESC 2 ESC 2 ESC 2 ESC 2 ESC 2 ESC 2 ESC 2 ESC 2 Leave UFS selected ESC 2 select Entire Distribution plus OEM support ESC 2 select c0d0 ESC 2 ESC 2 ESC 2 Auto layout ESC 2 ESC 2 ESC 4 customize layout remove /export/home 15768 for / 540 for swap ESC 2 ESC 2 ESC 2 ESC 2 ESC 2 -- installation begins... Repeat steps for tb9b,c,d bash-3.2# ldm add-domain tb9b bash-3.2# ldm add-domain tb9c bash-3.2# ldm add-domain tb9d bash-3.2# ldm add-vcpu 4 tb9b bash-3.2# ldm add-vcpu 4 tb9c bash-3.2# ldm add-vcpu 4 tb9d bash-3.2# ldm add-memory 4G tb9b bash-3.2# ldm add-memory 4G tb9c bash-3.2# ldm add-memory 4G tb9d bash-3.2# ldm add-vnet vnet1 primary-vsw0 tb9b bash-3.2# ldm add-vnet vnet1 primary-vsw0 tb9c bash-3.2# ldm add-vnet vnet1 primary-vsw0 tb9d bash-3.2# ldm add-vdisk vdisk1 fdisk1@primary-vds0 tb9b bash-3.2# ldm add-vdisk vdisk1 fdisk2@primary-vds0 tb9c bash-3.2# ldm add-vdisk vdisk1 fdisk3@primary-vds0 tb9d bash-3.2# ldm bind tb9b bash-3.2# ldm bind tb9c bash-3.2# ldm bind tb9d bash-3.2# ldm set-var auto-boot\?=false tb9b bash-3.2# ldm set-var auto-boot\?=false tb9c bash-3.2# ldm set-var auto-boot\?=false tb9d
history of creating a VirtualBox VM via command line
35 VBoxManage createvm -name windows -register 37 VBoxManage modifyvm windows --memory "512MB" --acpi on --boot1 dvd --nic1 net 39 VBoxManage modifyvm windows --memory 512 --acpi on --boot1 dvd --nic1 bridged 46 VBoxManage createvdi --filename "/home/oracle/VirtualBox-Disks/windowsdisk1.vdi" --size 18000 --register 47 VBoxManage createvdi --filename "/home/oracle/VirtualBox-Disks/windowsdisk1.vdi" --size 18000 51 VBoxManage modifyvm windows --hda "/home/oracle/VirtualBox-Disks/windowsdisk1.vdi" 52 VBoxManage storagectl 54 VBoxManage storagectl windows --name "IDE Controller" --add ide 55 VBoxManage modifyvm windows --hda "/home/oracle/VirtualBox-Disks/windowsdisk1.vdi" 56 VBoxManage openmedium dvd /home/oracle/en_win_srv_2003_r2_enterprise_cd1.iso 57 VBoxManage openmedium dvd /home/oracle/en_win_srv_2003_r2_enterprise_cd1.iso |grep medium 58 VBoxManage registerimage dvd /home/oracle/en_win_srv_2003_r2_enterprise_cd1.iso 59 VBoxManage closemedium dvd /home/oracle/en_win_srv_2003_r2_enterprise_cd1.iso 61 VBoxManage modifyvm windows --dvd /home/oracle/en_win_srv_2003_r2_enterprise_cd1.iso 62 VBoxManage storagectl windows 63 VBoxManage storageattach 64 VBoxManage storageattach windows --storagectl --port 0 --device 0 --type dvddrive --medium /home/oracle/en_win_srv_2003_r2_enterprise_cd1.iso 65 VBoxManage storageattach windows --storagectl "IDE Controller" --port 0 --device 0 --type dvddrive --medium /home/oracle/en_win_srv_2003_r2_enterprise_cd1.iso 68 VBoxHeadless --startvm windows -p 3389 69 VBoxHeadless --startvm windows 71 VBoxManage modifyvm 72 history|grep VBox 73 VBoxManage modifyvm windows --nic1 bridged --bridgeadapter eth0 74 VBoxManage modifyvm windows --nic1 bridged --bridgeadapter eth0:1 75 VBoxManage modifyvm windows --nic1 bridged --bridgeadapter1 eth0 76 VBoxHeadless --startvm windows -p 3389 & 77 VBoxManage modifyvm windows --nic1 bridged --bridgeadapter1 eth0 --hostifdev eth0 81 VBoxManage modifyvm windows --nic1 bridged --bridgeadapter1 eth0 --hostifdev eth0 82 VBoxManage modifyvm windows --nic1 bridged --bridgeadpter eth0 83 VBoxManage modifyvm windows --nic1 bridged --bridgeadpter1 eth0 84 VBoxManage modifyvm windows --nic1 bridged --bridgeadapter eth0 85 VBoxManage modifyvm windows --nic1 bridged --bridgeadapter1 eth0 86 VBoxManage list hostonlyifs 87 VBoxManage list bridgedifs 89 VBoxManage list bridgedifs 90 VBoxManage modifyvm windows --nic1 nat 91 VBoxHeadless --startvm windows -p 3389 & 92 VBoxHeadless 96 VBoxManage modifyvm windows --nic1 bridged --bridgeadapter1 eth0 100 VBoxHeadless --startvm windows -p 3389 & 105 VBoxHeadless --startvm windows -e "TCP/Ports=3389" 111 VBoxHeadless --startvm windows 125 cat VBox.log 133 VBoxManage modifyvm windows --vrde on 136 VBoxManage modifyvm windows --vrde on 137 VBoxHeadless --startvm windows -e "TCP/Ports=3389" 150 vi VBox.log 153 VBoxHeadless --startvm windows -p 3389 & 155 vi VBox.log 166 VBoxManage extpack install Oracle_VM_VirtualBox_Extension_Pack-4.1.2-73507.vbox-extpack 167 sudo VBoxManage extpack install Oracle_VM_VirtualBox_Extension_Pack-4.1.2-73507.vbox-extpack 168 VBoxHeadless --startvm windows -p 3389 & 177 VBoxManage storageattach 178 VBoxManage storageattach windows --storagectl 179 VBoxManage storageattach windows --storagectl "IDE Controller" --port 0 --device 0 --type hdd --medium /home/oracle/VirtualBox-Disks/windowsdisk1.vdi 182 VBoxManage storageattach windows --storagectl "IDE Controller" --port 1 --device 0 --type dvddrive --medium /home/oracle/en_win_srv_2003_r2_enterprise_cd1.iso 183 VBoxHeadless --startvm windows -p 3389 &