17 qlx02vwindows


Published on

Published in: Technology
  • Be the first to comment

  • Be the first to like this

No Downloads
Total views
On SlideShare
From Embeds
Number of Embeds
Embeds 0
No embeds

No notes for slide

17 qlx02vwindows

  1. 1. Unit 17 Integrating Linux in a Windows Environment
  2. 2. Objectives After completing this unit, you should be able to: •Access files on Windows filesystems • Run Windows programs •Access Windows servers • Read Windows document formats
  3. 3. Accessing Files on Windows Filesystems • Linux: Unified Filesystem • Virtual directory tree • All physical filesystems are "mounted" FCT * J^I I I/1 I { I X/BIN /LIB /SHARE /XLIRA-'' I I I 1NV.J/KDE /GNOME /ETC /IN—-''^ I I I I VS/TUXL /TUX2 /TUX3 /TUX4....X ►WINDOWS: DRIVE LETTERS FOR EACH SEPARATE FILESYSTEM C:
  4. 4. Mounting Windows Filesystems •To mount the first primary partition on your first IDE hard disk on the mount point /mnt/win95: # MOUNT /DEV/HDA1 /MNT/WIN95 ...OR # MOUNT -t vfat /DEV/HDA1 /MNT/WIN95 •All files on your C:-disk are now accessible in /mnt/win95 • Make permanent by adding this to /etc/fstab: /DEV/HDA5 / ext2 defaults 1 1 /DEV/HDA2 /BOOT ext2 defaults 1 2 /DEV/HDA6 swap swap defaults 0 0 /DEV/HDA1 /MNT/WIN95 vfat defaults 0 0
  5. 5. Accessing Windows Filesystems Directly MTOOLS is a collection of tools that can read/write Windows filesystems directly, using drive letters. # MCOPY C:AUTOEXEC.BAT /ROOT/AUTOEXEC.BAT # MFORMAT A: # MDIR A: • Devices must not be mounted! • Drive letters are mapped to physical devices in /ETC/MTOOLS.CONF: drive a: file="/dev/fd0" exclusive 1.44m mformat_onlY drive c: file="/dev/hda1"
  6. 6. Running Windows Programs •To run a Windows program, the underlying Windows OS needs to be emulated • Can be done at two levels: • EMULATE A PC AND INSTALL WINDOWS ON IT • EMULATE WINDOWS ITSELF • Note that you need a license for Windows if you use any Windows software (including single DLLs)
  7. 7. PC Emulators • Emulate a PC on which you install Windows • Do need a Windows license Bochs (http://bochs.soundforge.net) • EMULATES A COMPLETE PC IN SOFTWARE •CAN RUN UNDER ANY POSIX COMPATIBLE OS • Can run on any architecture •Open Source • Big performance loss VMWare (http://www.vmware.com) • Emulates a complete PC in software • Only runs on Linux/Intel or Windows NT/Intel • Commercial Product •About 30% performance loss
  8. 8. VMWare Screenshot FIÂT :L VMware Workstation [F8]: /VMWARE/WIN95/WIN95.CFG File Power Settings Devices View Help This Computer SA Network N eighborhood n3 H root®1 I2 4 | VMware Workst;
  9. 9. Windows Emulators win4lin (http://www.netraverse.com) • Commercial product • EMULATES Windows kernel • NEEDS Windows DLLs • NEEDS Windows license WINE - WINdows Emulator (http://www.winehq.com) • Open Source product • Does not need a Windows license if only WINE or third party DLLs are used •CAN USE WINDOWS DLLS (BEWARE OF LICENSE!) •To see if your application is supported, go to Web site CrossOver Office (http://www.codeweavers.com) • commercial extension to WINE
  10. 10. win4lin Screenshot
  11. 11. WINE Screenshot
  12. 12. Accessing Windows Servers Samba (http://www.samba.org) •Open Source product • Runs on any UNIX • Used to replace a Windows server (not covered here) • Also includes a number of client tools: smbclient, smbmount, smbprint smbclient allows you to retrieve information about a Windows server, and to access files "ftp-style" smbmount allows you to mount Windows shares over the network smbprint allows you to print documents to a Windows-attached printer
  13. 13. smbclient Examples # SMBCLIENT -L WINSERVER -N # SMBCLIENT -L WINSERVER -U USER # SMBCLIENT -L WINSERVER -U USER%PASSWORD # SMBCLIENT //WINSERVER/SHARE -U USER%PW SMB> GET FILEL smb> put file2 smb> quit Options: -L lists the shares on the server -N guest access -U qualified access
  14. 14. smbmount Examples •To mount a share as an filesystem: # smbmount //winserver/share /mnt/win95 ...or # mount -t smbfs //winserver/share /mnt/win95 # mount -t smbfs -o username=tux1 > password=secret //winserver/share /mnt/win95 • Make permanent by adding this to /etc/fstab: //WINSERVER/SHARE /MNT/WIN95 SMBFS DEFAULTS,USERNAME=USER%PASSWORD 0 0 /DEV/HDA5 /DEV/HDA2 /DEV/HDA6 / /BOO T SWA P ext2 defaults ext2 defaults swap defaults 1 1 1 2 0 0
  15. 15. smbprint smbprint is usually not called directly but integrated into printer spool mechanism Configure using the regular printer configuration tools •Select "SMB Printer" • Configure servername, printer name, printer type, username and password •After configuration the new printer can be used as a normal printer I
  16. 16. Reading Windows Document Formats • Most native office programs for Linux read and save Windows document formats • STAROFFICE/OPENOFFICE • KOFFICE • AbiWord $ file mytext.doc mytext.doc: Microsoft Office Document $ swriter mytext.doc Note that not all document features may be supported
  17. 17. Other Useful Programs rdesktop: Connect to a Windows Terminal Server vnc: Allows you to "take over" a Windows systems screen remotely dos2unix and unix2dos: Convert Windows text files (CR/LF) to UNIX text files (LF) cygwin (http://www.cygwin.com): Series of Linux tools running under Windows
  18. 18. Checkpoint T/F 1. To make a mount of a Windows filesystem permanent, you need to add it to /etc/fstab. 2. You want to run a third-party program under Linux that was written to run under Windows. Which solution does generally not require you to have a Windows license? a. Bochs b. WINE c. VMWare d. Win4Lin 3. What command allows you to mount a share from a Windows server?
  19. 19. Unit Summary •To access files on Windows filesystems, either mount these filesystems or use the mtools •To run Windows programs use a PC emulator such as Bochs or VMWare, or use a Windows emulator such as win4lin or WINE • CrossOver Office allows you to install Windows programs directly under Linux. •To access Windows servers you can use the client programs from the Samba product: smbclient, smbmount and smbprint •To read Windows document formats you can use almost any native Linux office program: StarOffice/OpenOffice, koffice, AbiWord and others • Several other useful programs exist, including rdesktop