Showing posts with label Ubuntu10.04 LTS. Show all posts
Showing posts with label Ubuntu10.04 LTS. Show all posts

Thursday, April 14, 2011

Winexe: To run code on windows machines from Linux

References:
The instructions on this post are a summary of information collected from this link. And I made some changes to it as well

These are instructions of how to get winexe working on Ubuntu 10.04.1 LTS system

To begin with make sure your system has the required libraries:
sudo apt-get install build-essential autoconf checkinstall

You will also need the python development libraries and header files:
sudo aptitude install python python-all python-dev python-all-dev python-setuptools


Now get the source code of winexe using svn. And apply the first patch:
svn co http://dev.zenoss.org/svn/trunk/wmi/Samba/source
cd source
wget https://gist.github.com/raw/843062/5bb87c4fa13688f65ca8b1e54fc42676aee42e5a/fix_winexe_service.diff
patch -p0 -i fix_winexe_service.diff


Now there is bug in the source/winexe/service.c file:
replace file
#define NT_STATUS_SERVICE_DOES_NOT_EXIST NT_STATUS(0xc0000424)

with
#define NT_STATUS_SERVICE_DOES_NOT_EXIST NT_STATUS(0x00000424)


Save,close and you are ready to compile:
cd source/
./autogen.sh
./configure
make proto bin/winexe
sudo cp bin/winexe /usr/local/bin/


and now you can test that that winexe is working correctly by doing:
winexe -W WORKGROUP -U Administrator%SecretPassword //192.168.xxx.xxx 'cmd.exe'

Friday, January 14, 2011

Compiling C/C++ code from Matlab on Ubuntu Linux machine

It seems that there is much easier way of compiling and running C/C++ from your Matlab application, than the one I was trying before.

Reproducing the instructions on this blog here:

My version of gcc (4.4) is too high for Matlab R2009b (4.3), and Matlab chokes on it. The solution is as follows:

Install gcc-4.3:

sudo apt-get install gcc-4.3
sudo apt-get install g++-4.3

In matlab, run mex -setup and select the GCC compiler.(Choose option 2). Next, at the command line:

sudo gedit ~/.matlab/R2009b/mexopts.sh

Replace all instances of CC=’gcc’ with CC=’gcc-4.3′, and al instances of CXX='g++' with CXX='g++-4.3'.
And restart Matlab !

Thursday, October 14, 2010

Disable the graphics on your machine

Just a quick note about how to disable the graphical user interface on your machine safely and quickly. This may be useful if you are having issues with your video card causing your system to crash. By disabling the graphics you could get command line interface to your machine.. and hopefully determine the exact problem to get your GUI to work.

mv /etc/init/gdm.conf /etc/init/gdm.disabled

This works on Ubuntu 10.04 LTS.
Remember that this would disable the graphics on all your boots. Not just the the one from which you make the change. And of course run the reverse mv command and reboot your machine to start your graphics again.

Monday, September 13, 2010

How to install Xen4.0 on Ubuntu 10.04 LTS

This post provides documentation about how to get Xen4.0 (the opensouce version) up and running on an Ubuntu 10.04 LTS (Long Term Support) 64-bit machine.

Start of with a fresh new installation of Ubuntu 10.04 LTS. Install the required packages first:
apt-get install bcc bin86 gawk bridge-utils iproute libcurl3 libcurl4-openssl-dev bzip2 module-init-tools transfig tgif texinfo texlive-latex-base texlive-latex-recommended texlive-fonts-extra texlive-fonts-recommended pciutils-dev mercurial build-essential make gcc libc6-dev zlib1g-dev python python-dev python-twisted libncurses5-dev patch libvncserver-dev libsdl-dev libjpeg62-dev iasl libbz2-dev e2fslibs-dev git-core uuid-dev ocaml libx11-dev
On a 64-bit machine, you will also need this additional package:
apt-get install gcc-multilib
The next step is to get Xen4.0.1
cd /usr/src/
wget http://bits.xensource.com/oss-xen/release/4.0.1/xen-4.0.1.tar.gz
Un-tar and make:
tar xf xen-4.0.1.tar.gz
cd xen-4.0.1
make xen
make tools
make stubdom
At this point you should have the Xen hypervisor/tools binaries in "dist/" directory ready for installation. Now run:
make install-xen
make install-tools
make install-stubdom
The next step is to download and compile a dom0 kernel, and to update the grub file. We can do this using the following commands:
make prep-kernels
This will create a build-linux-2.6-pvops_x86_64 directory in /usr/src/ which has by a .config file in it. You need to modify the .config file to suit your requirements. You can have a look at mine here. (Source Boris Derzhavets).
You could use make menuconfig from inside the build-linux-2.6-pvops_x86_64 to make alterations to your .config file.
cd build-linux-2.6-pvops_x86_64
make menuconfig
make
chmod g-s /usr/src/ -R
make deb-pkg
dpkg -i ../linux-image-2.6.32.21-xen_*.deb
depmod 2.6.32.21-xen
update-initramfs -c -k 2.6.32.21-xen
At this point enable Xend at boot:
update-rc.d xend defaults 20 21
update-rc.d xendomains defaults 21 20
When I typed in the last two lines, I got warning messages saying:
update-rc.d: warning: xend start runlevel arguments (2 3 4 5) do not match LSB
Default-Start values (3 4 5)
update-rc.d: warning: xend stop runlevel arguments (0 1 6) do not match LSB
Default-Stop values (0 1 2 6)

Apparently these messages are benign and should not cause any issues in the working of Xen Daemon. Now create the Grub2 entry for your new kernel:
vim /etc/grub.d/40_custom
Following is what I entered to in the 40_custom file. My installation still has issues because the graphics driver keeps crashing, and I think that the grub file has something to do with it.
#!/bin/sh
exec tail -n +3 $0
# This file provides an easy way to add custom menu entries. Simply type the
# menu entries you want to add after this comment. Be careful not to change
# the 'exec tail' line above.

menuentry 'Xen 4.0.1, Ubuntu 10.4 kernel 2.6.32.21' {
recordfail
insmod ext2
set root='(hd0,1)'
multiboot (hd0,1)/boot/xen-4.0.1.gz dummy=dummy dom0_mem=832M
module (hd0,1)/boot/vmlinuz-2.6.32.21-xen dummy=dummy root=/dev/sda1 nopat ro nomodeset console=tty0 earlyprintk=xen
module (hd0,1)/boot/initrd.img-2.6.32.21-xen
}
Update grub and reboot... And choose the correct grub option from the boot-up menu.
update-grub
reboot