Virtualizing a Linux System (Creating a Linux VM P2V)

Fuente: http://www.localizingjapan.com/blog/2011/03/05/virtualizing-a-linux-system-creating-a-linux-vm-p2v/

This tutorial article is going to show you how to create a Linux virtual machine from a physical Linux system. These instructions are generic enough to work with any Linux distribution, such as Ubuntu, Fedora, Red Hat, CentOS, Debian, Mint, etc.

There are many reasons why you would create a VM of a physical system you have running. You might want to test out things before you try them on your actual system. It is useful when you are translating to have both the English and Japanese (or other language) OS and applications open side by side to reference the correct translations easily. Whatever the reason, this article will show you one way to do it pretty easily.

Overview of the Linux VM creation task:

Tools and Resources Needed

  • SystemRescueCd ISO file
  • Blank CD-ROM or USB disk
  • USB disk drive large enough to fit entire Linux system
  • VMware or VirtualBox

Preparation Tasks

  1. Make note of the disk partitioning
  2. Create a bootable Linux rescue disk

Main Tasks

  1. Image the hard drive partitions
  2. Create an empty Virtual Machine
  3. Recreate the hard drive partitions
  4. Restore the hard drive partitions
  5. Set up the boot loader

Final Task – Boot the VM

Optional Task – Configure X11

Preparation Tasks

Make Note of the Disk Partitioning

On the physical Linux system we want to virualize, run the df command to list the partitions and mount points

df -h

Make a note of the partitions, their sizes, and mount points. You will use this information later to recreate the disk partitioning in the virtual machine.

Create a Bootable Linux Rescue Disk

For the task of converting a physical Linux system to a virtual machine we are going to use another version of Linux to do the work in. Any bootable version of Linux will work, and I really like SystemRescueCd for this task. It is a light-weight Linux system that comes with all the system tools you’ll need for this job like partimage and fdisk (or GParted).

Download the SystemRescueCd ISO file.

Burn the ISO file to a CD-ROM, or follow the instructions to make a bootable USB stick.

Power down the physical Linux computer we are going to virtualize and put the SystemRescueCd in the CD-ROM drive or USB drive.

Turn the computer on and boot to SystemRescueCd Linux.

Main Tasks

Image the Hard Drive Partitions

Plug in your external USB hard drive.

Run the dmesg command to find the device name of the USB hard drive.

dmesg

Look for your hard drive name and description. For example, if you plugged in a Western Digital My Passport drive you should see something similar to this:

usb 2-1: Product: My Passport 070A
usb 2-1: Manufacturer: Western Digital
sd 4:0:0:0: [sdb] 1463775232 512-byte logical blocks: (749 GB/697 GiB)
sd 4:0:0:0: [sdb] Write Protect is off
sd 4:0:0:0: [sdb] Mode Sense: 23 00 10 00
sd 4:0:0:0: [sdb] Assuming drive cache: write through
sdb: sdb1

The key piece of information here is the sdb1 on the last line. This is the device name we will use to mount the USB hard drive.

Create a directory to mount the USB hard drive. For example, a new directory called flash.

mkdir /mnt/flash

Mount the USB hard drive, device sdb1, on the newly created directory.

mount /dev/sdb1 /mnt/flash

Run the partimage program to image the partitions.

partimage

Use the GUI to select the partition to image.

Press Tab and enter the file name for the partition. For example (Assuming the partitions are on device sda):

/mnt/flash/sda1.partimage.gz

Press F5 twice to navigate to the next screens and press OK to start the imaging process.

Repeat this process for each partition on the Linux system. Make sure to name the files appropriately.

Note: Partimage will also show the partitions of the USB drive you mounted. Do not image the partitions of your USB disk. Also, do not image any extended or swap partitions.

When you are finished imaging all of the disk partitions, unmount the USB disk drive.

umount /mnt/flash

Shut down SystemRescueCd and restart your Linux system.

reboot

Create an Empty Virtual Machine

Create a new VM in VMware (or VirtualBox).

Configure the VM to have similar hardware specifications as the physical Linux computer: RAM, processor, hard disk. It is important that the hard disk be the same size or larger than the physical machine so the partitions fit.

Set the VM to boot from the CD-ROM drive using the SystemRescueCd ISO file.

Boot the empty virtual machine into SystemRescueCd.

Recreate the Hard Drive Partitions

Run the fdisk command to find the hard drive device.

fdisk -l /dev/sda

If it is sda and your drive was around 100 GB, you will see something like this:

Disk /dev/sda: 105.2 GB, 105226698752 bytes

Use fdisk to recreate the disk partitions of the original physical Linux computer. You should have made note of these in the preparation tasks. fdisk is a command line program to partition the drive. (You can also use the GUI GParted program in X Windows if you prefer. Press startx and select GParted from the menu.)

fdisk /dev/sda

Press n to add new partitions.

Press a to toggle the bootable partition (the /boot partition).

Press t to toggle the swap partition by setting it to 82.

Press w to write changes to disk.

Press m at any time for a list of options.

Restore the Hard Drive Partitions

Plug in your external USB hard drive and connect it to the virtual machine.

Run the dmesg command to find the device name of the USB hard drive.

dmesg

Look for your hard drive name and description.

Create a directory to mount the USB hard drive. For example, a new directory called flash.

mkdir /mnt/flash

Mount the USB hard drive, for example device sdb1, on the newly created directory.

mount /dev/sdb1 /mnt/flash

Run the partimage program to restore the partitions.

partimage

Use the GUI to select the partition to restore.

Press Tab and enter the file name and location for the image file. For example:

/mnt/flash/sda1.partimage.gz

Press Tab and change the Action to be done to Restore partition from an image file.

Press F5 twice to navigate to the next screens and press OK to start the restore image process. In VMware you will probably have to press Function F5 to get the F5 key to work.

Repeat this process for each partition on the Linux system.

When you are finished imaging all of the disk partitions, unmount the USB disk drive.

umount /mnt/flash

Set Up the Boot Loader

The final step is to set up the boot loader and install it into the master boot record.

Mount the boot directory. For example, if sda1 is the boot partition and sda3 is the root partition.

mkdir /mnt/root
mount /dev/sda3 /mnt/root
mount /dev/sda1 /mnt/root/boot

Verify the configuration of the boot configuration file. Assuming you are using GRUB:

nano /mnt/root/boot/grub/device.map

Nano is a Linux text editor. You can also use pico or vi.

You want to verify that the device in the configuration file matches what it is in the VM. For example, if it says this:

(hd0) /dev/hda

You may need to change hda to sda. In this example we need to change it.

(hd0) /dev/sda

Exit Nano or whatever text editor you used.

Run grub-install to install GRUB into the MBR.

grub-install --root-directory=/mnt/root /dev/sda

Final Tasks

We’re all done. Now reboot in SystemRescueCd and your virtual machine should now boot into the same Linux setup that is on your physical machine.

reboot

This VM is now an exact copy of the physical Linux computer. You have successfully done a P2V (Physical to Virtual) conversion of your Linux system.

Optional Task – Configure X11

Depending on the version of Linux you are using, it may not be able to use the VMware settings to display X Windows properly. In that case, you will need to make a simple change to the X11Config file.

First, make a backup of the X11Config file. This assumes it is located in /etc/X11.

cp /etc/X11/XF86Config /etc/X11/XF86Config.backup2

Edit the X11Config file.

nano /etc/X11/XF86Config

Change the Driver and BoardName settings in the Device section from the VMware settings to a generic Vesa setting.

Section      "Device"
Identifier   "Videocard0"
Driver       "vesa"
VendorName   "Videocard vendor"
BoardName    "VESA driver (generic)"

Save the file and restart. You should be able to get X Windows to start now.

That’s it. It looks like a lot of steps, but it is not that difficult to do. The longest part is imaging and restoring the partitions.

Now that you have a virtual version of your Linux computer, you are able to do unique things like snapshots and work with multiple configurations or languages at the same time. This is really helpful when translating software from one language to another because you can now have both language versions running at the same time on the same desktop.

 

Categorías:virtualización Etiquetas: ,

Las posturas para no dañar la maldita espalda…

Si, lo sabemos, pero no viene mal volver a dar la vara con la postura ideal cuando estamos delante de la pantallita de turno…

 

la postura ideal

Categorías:miscellaneous Etiquetas:

inSSIDer: Escáner de redes inalámbricas (Wi-Fi) open source para Windows 7

Fuente: http://www.bloginformatico.com/inssider-escaner-de-redes-inalambricas-wi-fi-open-source-para-windows-7.php

 

inSSIDer

Muchas veces escanear una red inalámbrica no debería ser nada difícil, porque tanto Windows o el software controlador de nuestro adaptador inalámbrico incluyen herramientas que permiten en pocos segundos saber las redes Wi-Fi están a nuestro alrededor. Pero siempre es bueno probar diferentes opciones, y es por eso que les presento inSSIDer, un software libre para Windows 7.

inSSIDer tiene un funcionamiento bastante concreto: escanear las redes inalámbricas que están a tu alcance, haciendo uso del adaptador inalámbrico que poseas, evidentemente. Algo que noté cuando estaba probando este programa es que es bastante rápido, muy fácil de usar. Sólo basta con descargarlo, e instalarlo, y de una vez procedemos a ejecutarlo, para disfrutar de su servicio.

El programa es compatible no sólo con Windows 7, sino también con Windows Vista, XP, 2000, en versiones tanto de 32 como de 64 bits. inSSIDer está disponible en español, aunque en su menú me encontré con algunas palabras en inglés, así que no está totalmente traducido por ahora pero por lo menos la mayoría de las palabras sí. Sólo requiere hacer clic en “Escanear” para proceder.

Entre las características más destacadas de inSSIDer tenemos las siguientes:

  • Muestra un gráfico de la intensidad que tienen las diferentes señales de red
  • Obtiene datos de cada una de las redes: Dirección MAC, Nivel de seguridad, SSID, Canal, Tipo de red, Velocidad y la marca del dispositivo de red utilizado
  • Permite ver gráficos del canal 5GHz y 2.4GHz
  • Soporte para señales GPS
  • Totalmente open source y disponible en español

Es una herramienta bastante interesante para administradores de red. inSSIDer es perfecto para el escaneo de redes aledañas a radio. Otro programa gratis bastante similar es WirelessNetView.

Visto en Snap Files
Enlace | inSSIDer

Categorías:redes Etiquetas:

DeSopa: la extensión para Firefox que ignora el bloqueo DNS

Fuente:  http://alt1040.com/2011/12/desopa-la-extension-para-firefox-que-ignora-el-bloqueo-dns

Siempre habrá un camino para saltarse los muros de la censura. Si no es este será otro y como no se le pueden poner puertas a la innovación y a la creación, aquí va una “ración” de ella. A unas horas de que vuelve a plantearse SOPA, los usuarios lanzan la extensión DeSopa, un add-on para el navegador de Mozilla que promete saltarse las “normas” (y el bloqueo DNS) del proyecto de ley.

DeSopa es la misma respuesta que hemos encontrado en el pasado a la censura. La misma por la que se hicieron famosos MAFIAAfire con la creación de extensiones capaces de saltarse los filtros antipiratería de Google (Gee! No Evil), la posibilidad de redirección automática a los sitios bloqueados por la incautación de dominios en Estados Unidos (como el caso de rojadirecta) o incluso la última e irónica extensión The Pirate Bay Dancing, un add-on capaz de evitar la censura en sitios torrents.

Ayer también os hablábamos de SOPA Lens, una extensión para Chrome que simulaba lo que ocurriría con la ley aprobada.

Todos ellos tienen en común con DeSopa la inspiración por buscar soluciones creativas para sortear la censura. En este caso podemos decir que se trata de la primera extensión “anti-sopa” para el navegador. Una herramienta que una vez instalada y a través de un sólo click, el usuario podrá resolver el dominio bloqueado vía servidores DNS extranjeros, pasando por encima de los bloqueos domésticos en los que se pudiera haber incurrido y permitiendo al usuario navegar por el sitio.

Así lo contaba hace unas horas su desarrollador T Rizk:

Siento que el público en general no es consciente de la gravedad de SOPA. El Congreso parece que está a punto de atender a los intereses particulares de los involucrados en detrimento de Internet, como si eso dependiese para que yo y muchos otros vivamos y respiremos.

Podría ser que algunos miembros del Congreso no tengan conocimientos de tecnología y no entienden que es técnicamente imposible trabajar así, en absoluto. Así que aquí está una prueba con la que espero que les ayude a errar por el lado de la razón y SOPA se vote en contra.

En cualquier caso, parece que el Comité está decidido a aprobarla ahora o dentro de una semana o si no, el próximo año. Es un esfuerzo posiblemente pactado en la medida que las presiones de los grupos pro-copyright han crecido en poder. Los mismos que utilizan las “técnicas” de piratería que intentar derribar.

Hoy nos enterábamos también del precio al que debería hacer frente la propia RIAA, una de las grandes impulsoras de la ley, si aplicásemos los métodos de multa por infracción. YouHaveDownloaded nos mostraba esta semana que sus IPs habían descargado 60 episodios de la serie Dexter.

Si las multas de los titulares de derechos sobre los usuarios son de 150.000 dólares por daños y perjuicios en cada obra copiada y distribuida ilegalmente… la organización se enfrentaría a 9 millones de dólares por la descarga de la serie, todos con cheque a la cuenta de la CBS.

Esa es la RIAA, la misma que un año antes sacudía a una familia. Una madre de cuatro hijos tendrá que pagar 1,5 millones por la descarga de 24 canciones que compartió en la red. Ella sí tendrá que enfrentarse a la ley. Una ley que como SOPA, está escrita para unos (la mayoría de los usuarios) y el beneficio de unos pocos.

Quizá sólo por esto vale la pena apoyar a cuantas extensiones y propuestas intenten defendernos de lo que está por venir.

Categorías:internet, seguridad

10 editores html online

13 diciembre 2011 Deja un comentario

Fuente: http://geeksroom.com/2011/04/10-de-los-mejores-editores-html-online-y-gratuitos/48432/

En ocasiones es necesario retocar ligeramente alguna página html, con lo que poder disponer de un sencillo editor online nos viene de “perlas”.

Lista con 10 de los mejores editores HTML online

1. Quackit Online HTML Editor: Codifique tanto como pueda y vea los resultados al hacer clic en ‘source‘.
2. Real-Time HTML Editor: No hay más la necesidad de estar cambiando ventanas para ver el efecto de la edición de su HTML.
3. Online HTML Editor: Vea de manera anticipada cómo se vería su sitio web en realidad.
4. Amy Editor: Un editor HMTL sencillo que soporta Ruby, Python, Texy!, PHP y otros.
5. Tiny MCE: Uno de los recursos favoritos de los desarrolladores y diseñadores web en el mundo.
6. Ajax.org Cloud9 Editor: Javascript fácil de poner en tu sitio y sucesor del Mozilla Skywriter (Bespin) Project.
7. HTML Instant: Un editor HTML en tiempo real!
8. HTML Editor: Escriba lo que quiera y obtenga la fuente HTML.
9. WYSIWYG HTML Editor: Para templates en eBay Auction
10. Online – HTML – Editor: Top rated HTML Editor por Web Hosting Search.

Los parámetros de selección varían de acuerdo a varios indicadores. Por ello si usted tiene experiencia con HTML y utiliza otros medios que los citados, apreciamos comparta esa información con nuestros lectores.

Read more: http://geeksroom.com/2011/04/10-de-los-mejores-editores-html-online-y-gratuitos/48432/#ixzz1gP8W6wbN

Categorías:internet Etiquetas: ,

postgresql: cómo obtener datos entre diferentes base de datos

12 diciembre 2011 Deja un comentario

Fuente: http://stackoverflow.com/questions/6083132/postgresql-insert-into-select

Fuente: http://roy-rc.blogspot.com/2010/08/postgresql-dblink-conexion-entre-bases.html

A veces es necesario poder copiar datos entre diferentes bases de datos, que incluso pueden residir en diferentes servidores. Postgresql proporciona una librería interesante para poder realizar dicho cometido.

DBlink consta de un conjunto de funciones diseñadas para realizar conexiones entre bases de datos Postgres, en el mismo server o en otros.. lo que se necesita es instalar DBlink en el servidor que hace la peticion..
Para implementar esto debes instalar el paquete contrib de la version que usas de postres
1
# aptitude install postgresql-contrib-8.3
el contrib de postgres provee una serie de funciones muy utiles para desarrolladores y administradores.
Para instalar la funcion en tu BD debes ser el usuario postgres y por lineas de comando:
1
2
$ cd /usr/share/postgresql/8.3/contrib
$ psql test_db u_test -h localhost < dblink.sql

Te conectas a la BD que tiene instalado el DBlink y realizas la consulta

1
$ psql test_db u_test -h localhost
La idea es trear datos de la BD my_db que esta en el servidor 191.168.50.90 y mostrarlos en la conexion establecida en test_db en localhost
1
2
3
test_db=# select * from
dblink ('dbname=my_db hostaddr=191.168.50.90 user=u_test password=123456 port=5432',
'select id,descripcion from tabla')  as t1(id int4,descripcion text);

Por ejemplo:

En la bbdd1 creamos una tabla:

psql dbtest CREATE TABLE tblB (id serial, time integer);

INSERT INTO tblB (time) VALUES (5000), (2000);

 

En la bbd2, creamo otra tabla, y la alimentaremos desde la tabla que reside en otra instancia:

psql postgres CREATE TABLE tblA (id serial, time integer);

INSERT INTO tblA     SELECT id, time      FROM dblink(‘dbname=dbtest’, ‘SELECT id, time FROM tblB’)     AS t(id integer, time integer)     WHERE time > 1000;

illatà !

 

Categorías:base datos

Como librarse del plugin-container.exe en Firefox

7 diciembre 2011 Deja un comentario

Fuente: http://www.atenciontecnica.es/?p=137

En una de las últimas actualizaciones de Firefox incluyeron en su momento un nuevo complemento llamado Plug-in container, cuyo objetivo es aglutinar distintos plug-ins en uno solo. Este tiene un proceso dedicado, independiente del propio de Firefox.

A pesar de que muchos usuarios de Firefox disfrutan de equipos potentes y mucha memoria RAM, hay muchos otros que utilizan equipos que tienen ya unos cuantos años, a los cuales les puede costar soportar un proceso como el del Plug-in container (plugin-container.exe) el cual absorve entre 40 y 50 MB. Esto sumado al proceso de firefox.exe eleva el requerimiento total, que podría oscilar entre los 160 y 200 MB.

Este plugin no inhabilita todos los plugins anteriores, los cuales pueden seguir utilizándose normalmente. Si quieres librarte de él porque crees que te está sobrecargando demasiado la máquina hay una manera.

1 – Ir a Herramientas -> Complementos -> Plugins.

2 – Desactivar todos los plugins asociados a Flash.

3 – En la barra de direcciones acceder a la configuración de Firefox escribiendo “about:config”. Utilizando el filtro de la parte superior, buscar “ipc”.

4 – Buscar la siguiente línea:

dom.ipc.plugins.enabled.npswf32.dll;true

5 – Hacer click derecho sobre esta línea y seleccionar “Modificar”. Modificar el valor true por false.

6 – Salir del Firefox y volver a entrar.

7 – Volver a acceder a Herramientas -> Complementos -> Plugins, y activar los plug-ins asociados a Flash.

Al deshabilitar la librería anterior y volver a activar el plugin de Flash este funcionaría como antes de la actualización. Así un Firefox limpio y funcionando normalmente no tendría porque superar los 130, 140 MB de memoria requerida.

Actualización:

Como me ha hecho notar acertadamente un amigo, para que el Plugin container no se active con otros formatos, como puede ser Quicktime, en el proceso de deshabilitación y habilitación de plugins (paso 1, 2 y 7) anterior debe incluirse sus respectivos plugins.

La .dll del paso 4 en el caso de Quicktime sería:

dom.ipc.plugins.enabled.npqtplugin.dll

Me apresuré a plantear el ejemplo solo con Flash. Espero que ahora con estos dos ejemplos concretos podáis eludir el Plugin container en la mayoría de los casos.

 

Categorías:internet Etiquetas:
Seguir

Get every new post delivered to your Inbox.